org.hestiastore:index-tools

Offline export/import CLI for HestiaStore indexes.


Keywords
java, key-value-store, storage-engine
License
LGPL-3.0

Documentation

example workflow

jbindex

Goal is to provide easy to use key value map for billions of records using just one directory and some space.

It's simple fast index. Work with index should be split into phases of:

  • Writing data to index. All data that should be stored in index should be send to index.
  • Building index. In this phase data are organized for fast access.
  • Search through index. In this phase it's not possible to alter data in index.

Index is not thread safe.

Useful links

Basic work with index

Index could be in following states:

Index methods

Index should be created with builder, which make index instance. For example:

final Index<Integer, String> index = Index.<Integer, String>builder()
        .withDirectory(directory)
        .withKeyClass(Integer.class)
        .withValueClass(String.class)
        .build();

Index states

Interruption of process of writing data to index could lead to corruption of entire index.

Limitations

Staled result from index.getStream() method

Data from index.getStream() method could be staled or invalid. It's corner case when next readed key value pair is changed. Index data streaming is splited into steps hasNextElement() and getNextElement(). Following example will show why it's no possible to use index cache:

index.hasNextElement(); // --> true

Now next element has to be known to be sure that exists. Let's suppose that in index is just one element <k1,v1>.

index.delete("k1");
index.nextElement(); // --> fail

last operation will fail because there is not possible to find next element because <k1,v1> was deleted. To prevent this problem index cache is not used during index streaming. If all index content should be streamed than before streaming should be compact() method and during streaming data shouldn't be changed.