Skip to content

pmem-bot/pmemkv-java

 
 

Repository files navigation

Travis build status GHA build status PMEMKV-JAVA version

pmemkv-java

Java bindings for pmemkv, using Java Native Interface. Currently functionally equal to pmemkv in version 1.0. Some of the new functionalities (from pmemkv 1.1+) are not available yet.

All known issues and limitations are logged as GitHub issues or are described in pmemkv's man pages.

Java API is documented with javadocs and can be found as html here:

Dependencies

  • pmemkv - native key/value library
  • Java 8 or higher
  • Apache Maven - build system
  • Used only for development & testing:

Installation

Start by installing pmemkv (currently at least in version 1.0.2) in your system.

It may be necessary to configure a proxy and set JAVA_HOME environment variable:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Clone the pmemkv-java tree:

git clone https://github.com/pmem/pmemkv-java.git
cd pmemkv-java

Build and install Java Native Interface (JNI) and java bindings:

mvn install

If dependencies (pmemkv, libpmemobj-cpp, pmdk, etc.) are installed in non-standard location it may be also necessary to set it in LD_LIBRARY_PATH, e.g.:

LD_LIBRARY_PATH=path_to_your_libs mvn install

Testing

This library includes a set of automated tests that exercise all functionality.

LD_LIBRARY_PATH=path_to_your_libs mvn test

Examples

We are using /dev/shm to emulate persistent memory in examples.

Examples can be found within this repository in examples directory. To execute them, run e.g.:

cd examples
javac -cp ../src/main/target/*.jar StringExample.java
PMEM_IS_PMEM_FORCE=1 java -ea -Xms1G -cp .:`find ../src/main/target -name *.jar` -Djava.library.path=../src/main/cpp/target StringExample

Documentation

Docs can be generated using mvn by executing commands:

mvn javadoc:javadoc

About

Java bindings for pmemkv

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 60.6%
  • Shell 22.2%
  • C++ 17.2%