Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example B: update Web description #8

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion templates/examples/B/body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}

<p>
If the program built without errors, continue on to the next step below.
Expand All @@ -133,6 +133,68 @@ Now you can try running the program using the above commands.

{{run "./run_py.sh"}}

{{step "Using libpmemkv in Java"}}

<p>
And again, the same program as above - this time implemented in Java.
The command-line interface is identical to the C++ version.
<p>
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"}}

<p>
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"}}

<p>
If the program built without errors, continue on to the next step below.

{{step "Run The Java Project"}}

<p>
This example runs three different ways,
depending on the command-line arguments:
<ul>
<li><tt>java PmemkvExample pmemfile</tt> <i>(print all k-v pairs)</i>
<li><tt>java PmemkvExample pmemfile key</tt> <i>(print the value)</i>
<li><tt>java PmemkvExample pmemfile key value</tt> <i>(add a k-v pair)</i>
</ul>
<p>
You can edit the script below and run it
again and again, to experiment with different commands.

{{edit "run_java.sh"}}

<p>
Now you can try running the program using the above commands.

{{run "./run_java.sh"}}

{{step "Run All Bindings Alternatively"}}

<p>
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.
<p>
You can edit the script below and run it
again and again, to experiment with different commands.

{{edit "run_cross_lang.sh"}}

<p>
Now you can try running the program using the above commands.

{{run "./run_cross_lang.sh"}}

<p>
Like all examples in this workshop, any changes you make
are to your own clone of the repository. Your
Expand Down
2 changes: 1 addition & 1 deletion templates/examples/B/description.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<br><br>
This example shows C++ and Python language bindings for
This example shows C++, Python, and Java language bindings for
libpmemkv.
{{template "tocEntryEnd" .}}