Project Polygene has retired. For details please refer to its Attic page.
LevelDB EntityStore
Polygene™
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 57. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.entitystore-leveldb

3.0.0


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
{
    /**
     * 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();

    @Optional
    Property<Boolean> errorIfExists();
}

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