Zest™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

LevelDB EntityStore

code

docs

tests

EntityStore service backed by a LevelDB embedded database.

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.

By default use the native implementation through JNI bindings and fallback to the pure Java implementation if not available on the current platform. Used implementation can be forced in the configuration.

The LevelDB EntityStore relies on the FileConfig Library to decide where it stores its database.

Table 65. Artifact

Group IDArtifact IDVersion

org.qi4j.extension

org.qi4j.extension.entitystore-leveldb

2.1


Assembly

Assembly is done using the provided Assembler:

public void assemble( ModuleAssembly module )
    throws AssemblyException
{
  [...snip...]

    new LevelDBEntityStoreAssembler().
        withConfig( config, Visibility.layer ).
        identifiedBy( "java-leveldb-entitystore" ).
        assemble( module );
          [...snip...]

}

Configuration

Here are the configuration properties for the LevelDB EntityStore:

public interface LevelDBEntityStoreConfiguration
    extends ConfigurationComposite
{

    /**
     * LevelDB flavour, can be 'java' or 'jni'.
     * By default, tries 'jni' and fallback to 'java'.
     */
    @Optional
    Property<String> flavour();

    @Optional
    Property<Integer> blockRestartInterval();

    @Optional
    Property<Integer> blockSize();

    @Optional
    Property<Long> cacheSize();

    @Optional
    Property<Boolean> compression();

    @Optional
    Property<Integer> maxOpenFiles();

    @Optional
    Property<Boolean> paranoidChecks();

    @Optional
    Property<Boolean> verifyChecksums();

    @Optional
    Property<Integer> writeBufferSize();

}

All configuration properties are defaulted to the implementation defaults meaning that you can use LevelDB EntityStore service without configuration.