13.5. LevelDB Cache Store
LevelDB is a key-value storage engine that provides an ordered mapping from string keys to string values.
The LevelDB Cache Store uses two filesystem directories. Each directory is configured for a LevelDB database. One directory stores the non-expired data and the second directory stores the expired keys before a purge.
13.5.1. Configuring LevelDB Cache Store
Procedure 13.5. To configure LevelDB Cache Store:
- Obtain the
leveldbjni-all-1.7.jar
file from https://github.com/fusesource/leveldbjni and copy it to themodules/system/layers/base/org/fusesource/leveldbjni-all/main
directory. - Modify the
module.xml
file to include JAR files in the resources:<module xmlns="urn:jboss:module:1.1" name="org.fusesource.leveldbjni-all"> <properties> <property name="jboss.api" value="private"/> </properties> <resources> <resource-root path="leveldbjni-all-1.7.jar"/> <!-- Insert resources here --> </resources> <dependencies> </dependencies> </module>
- Add the following to a cache definition in
standalone.xml
to configure the database:<leveldb-store path="/path/to/leveldb/data" passivation="false" purge="false" > <expiration path="/path/to/leveldb/expires/data" /> </leveldb-store>
Note
The LevelDB library and JNI connector are not part of the JBoss Data Grid 6.2 distribution. To use the tested version, add the file
leveldbjni-all-1.7.jar
from https://github.com/fusesource/leveldbjni to your JBoss Data Grid deployment.