From dd8778d33eb95a31cdf4915033671132d718aa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= Date: Mon, 13 Sep 2021 11:17:13 +0200 Subject: [PATCH] example B: update Web description matching updated code, in: https://github.com/pmemhackathon/2021-04-21/pull/2 --- templates/examples/B/body.tmpl | 64 ++++++++++++++++++++++++++- templates/examples/B/description.tmpl | 2 +- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/templates/examples/B/body.tmpl b/templates/examples/B/body.tmpl index 1f619e8..895ef56 100644 --- a/templates/examples/B/body.tmpl +++ b/templates/examples/B/body.tmpl @@ -107,7 +107,7 @@ below to build the program on the server. If you see any build errors, scroll back up to the source editing window and fix them. -{{build "make kv"}} +{{build "make python"}}

If the program built without errors, continue on to the next step below. @@ -133,6 +133,68 @@ Now you can try running the program using the above commands. {{run "./run_py.sh"}} +{{step "Using libpmemkv in Java"}} + +

+And again, the same program as above - this time implemented in Java. +The command-line interface is identical to the C++ version. +

+You can edit the program below and make changes if you'd like to +experiment, or just run it as-is. + +{{edit "PmemkvExample/src/main/java/PmemkvExample.java" "PmemkvExample/Makefile" "PmemkvExample/pom.xml"}} + +

+Once you've made any edits to the +above source files, click the button +below to build the program on the server. +If you see any build errors, scroll back up +to the source editing window and fix them. + +{{build "make java"}} + +

+If the program built without errors, continue on to the next step below. + +{{step "Run The Java Project"}} + +

+This example runs three different ways, +depending on the command-line arguments: +

+

+You can edit the script below and run it +again and again, to experiment with different commands. + +{{edit "run_java.sh"}} + +

+Now you can try running the program using the above commands. + +{{run "./run_java.sh"}} + +{{step "Run All Bindings Alternatively"}} + +

+In all above versions of the example the same engine ("cmap") +was used. This allows to mix the execution of these programs +to access the same data (in the same pmemfile). +To illustrate it works smoothly see the commands below. +

+You can edit the script below and run it +again and again, to experiment with different commands. + +{{edit "run_cross_lang.sh"}} + +

+Now you can try running the program using the above commands. + +{{run "./run_cross_lang.sh"}} +

Like all examples in this workshop, any changes you make are to your own clone of the repository. Your diff --git a/templates/examples/B/description.tmpl b/templates/examples/B/description.tmpl index 88f8f04..70cfd24 100644 --- a/templates/examples/B/description.tmpl +++ b/templates/examples/B/description.tmpl @@ -11,6 +11,6 @@ through this example is recommended for everyone since it provides an overview of how the most common libraries are used together.

-This example shows C++ and Python language bindings for +This example shows C++, Python, and Java language bindings for libpmemkv. {{template "tocEntryEnd" .}}