Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

pmem/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 - Key-value Datastore for Persistent Memory
    • pmemkv source package (pmemkv-devel or libpmemkv-dev)
  • Java 8
  • gcc-c++ compiler
  • Apache Maven 3 - build system

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(s) it may be also necessary to set up: CPLUS_INCLUDE_PATH and LIBRARY_PATH for compiling and linking JNI code (gcc env. variables), LD_LIBRARY_PATH for examples and tests build/execution.

CPLUS_INCLUDE_PATH=<path_to_includes> \
LIBRARY_PATH=<path_to_libs> \
LD_LIBRARY_PATH=<path_to_libs> mvn install

Testing

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

LD_LIBRARY_PATH=<path_to_libs> mvn test

Examples

We use /dev/shm with emulated persistent memory in examples.

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

cd examples
mvn package
PMEM_IS_PMEM_FORCE=1 java -ea -Xms1G -jar StringExample/target/StringExample-1.0.0-jar-with-dependencies.jar

Contributing

Any contributions are welcome. Process, hints and good practices are described in CONTRIBUTING.md.

Debugging

Debugging process is described in DEBUGGING.md.

Documentation

Docs can be generated using mvn by executing commands:

mvn javadoc:javadoc

Contact us

For more information about pmemkv and java bindings, contact Igor Chorążewicz (igor.chorazewicz@intel.com), Piotr Balcer (piotr.balcer@intel.com) or post on our #pmem Slack channel using this invite link or Google group.

About

Java bindings for pmemkv

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 13