View on GitHub

DRUMS

DRUMS: Disk Repository with Update Management and Select Option

Download this project as a .zip file Download this project as a tar.gz file Download release 0.4.2 as a .jar library

Write Tutorial

To instantiate DRUMS some parameters must be set. Instantiate GlobalParameters with a prototype of your storable. All parameters are read by default from ./src/main/resources/drums.properties. The parameters are described in the JavaDoc as well as in the properties file.

GlobalParameters gp = new GlobalParameters(myStorable-prototype);

Further, a consistent HashFunction must be available. For simplicity we recommend the provided RangeHashFunction. The RangeHashFunction maps all records in a given range to one particular Bucket. The following code creates a new RangeHashFunction with 128 equal sized ranges between 0 and 256^4.

RangeHashFunction hf = new RangeHashFunction(128, 4, "myHashFunctionFile");

Static factory-methods in the DRUMSInstantiator-class can be used to get the desired DRUMS-object.

DRUMS drums = DRUMSInstantiator.createTable(hf, gp);

Now, records can be inserted as follows.

drums.insertOrMerge(myStorables);

To make sure, that all records are persisted, the current DRUMS-instance must be closed.

drums.close();

Example

For a concrete example please have a look at BioDRUMS. This file provides a full functional example for creating a DRUMS table and inserting some real biological data.