419
Using LLPL in Java Applications
To use LLPL with your Java application, you need to have PMDK and LLPL installed
on your system. To compile the Java classes, you need to specify the LLPL class path.
Assuming you have LLPL installed on your home directory, do the following:
$ javac -cp .:/home//llpl/target/classes LlplTest.java
After that, you should see the generated ∗.class file. To run the main() method
inside your class, you need to again pass the LLPL class path. You also need to set the
java.library.path environment variable to the location of the compiled native library
used as a bridge between LLPL and PMDK:
$ java -cp .:/.../llpl/target/classes \
-Djava.library.path=/.../llpl/target/cppbuild LlplTest
PCJ source code examples can be found in the resources listed in the following:
• Code Sample: Introducing the Low-Level Persistent Library (LLPL)
for Java∗ – https://software.intel.com/en-us/articles/
introducing-the-low-level-persistent-library-llpl-for-java
• Code Sample: Create a “Hello World” Program Using the Low-Level
Persistence Library (LLPL) for Java∗ – https://software.intel.
program-using-the-low-level-persistence-library-llplfor-java
• Enabling Persistent Memory Use in Java – https://www.snia.
org/sites/default/files/PM-Summit/2019/presentations/05PMSummit19-Dohrmann.pdf
Summary
At the time of writing this book, native support for persistent memory in Java is an
ongoing effort. Current features are mostly volatile, meaning the data is not persisted
once the app exits. We have described several features that have been integrated and
shown two libraries – LLPL and PCJ – that provide additional functionality for Java
applications.
Appendix d JAvA for persistent MeMory
Précédent

- 439/457

Suivant