Skip to content

Commit

Permalink
[pmemkv] Add PmemKV client using pmemkv's Java API.
Browse files Browse the repository at this point in the history
pmemkv is a local/embedded key-value datastore optimized
for persistent memory (https://github.com/pmem/pmemkv-java).
  • Loading branch information
KFilipek authored and lukaszstolarczuk committed Sep 13, 2021
1 parent ce3eb9c commit 391ba30
Show file tree
Hide file tree
Showing 11 changed files with 664 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/bindings.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012 - 2020 YCSB contributors. All rights reserved.
# Copyright (c) 2012 - 2021 YCSB contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down Expand Up @@ -61,6 +61,7 @@ mongodb:site.ycsb.db.MongoDbClient
mongodb-async:site.ycsb.db.AsyncMongoDbClient
nosqldb:site.ycsb.db.NoSqlDbClient
orientdb:site.ycsb.db.OrientDBClient
pmemkv:site.ycsb.db.PmemKVClient
postgrenosql:site.ycsb.postgrenosql.PostgreNoSQLDBClient
rados:site.ycsb.db.RadosClient
redis:site.ycsb.db.RedisClient
Expand Down
3 changes: 2 additions & 1 deletion bin/ycsb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright (c) 2012 - 2020 YCSB contributors. All rights reserved.
# Copyright (c) 2012 - 2021 YCSB contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down Expand Up @@ -90,6 +90,7 @@ DATABASES = {
"mongodb-async": "site.ycsb.db.AsyncMongoDbClient",
"nosqldb" : "site.ycsb.db.NoSqlDbClient",
"orientdb" : "site.ycsb.db.OrientDBClient",
"pmemkv" : "site.ycsb.db.PmemKVClient",
"postgrenosql" : "site.ycsb.postgrenosql.PostgreNoSQLDBClient",
"rados" : "site.ycsb.db.RadosClient",
"redis" : "site.ycsb.db.RedisClient",
Expand Down
7 changes: 6 additions & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2012 - 2020 YCSB contributors. All rights reserved.
Copyright (c) 2012 - 2021 YCSB contributors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
Expand Down Expand Up @@ -194,6 +194,11 @@ LICENSE file.
<artifactId>orientdb-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>site.ycsb</groupId>
<artifactId>pmemkv-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>site.ycsb</groupId>
<artifactId>postgrenosql-binding</artifactId>
Expand Down
79 changes: 79 additions & 0 deletions pmemkv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!--
Copyright (c) 2015 - 2021 YCSB contributors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->

# PmemKV Driver for YCSB
This driver is a binding for the YCSB facilities to operate against a [PmemKV](https://github.com/pmem/pmemkv).
It uses the PmemKV Java bindings.

## Quick Start

### 0. Install PmemKV Java Binding
**Optionally** you can compile and install custom version of PmemKV Java binding.
The min. supported version is `1.2.0`.

>Note: If you want to use custom installation, you'll have to set additional
>maven parameter for building/execution of **PmemKV module**: `-Dpmemkv.packageName=pmemkv`.
Simple follow [PmemKV Java installation instruction](https://github.com/pmem/pmemkv-java#installation),
including at least:

export JAVA_HOME=#PATH_TO_YOUR_JAVA_HOME
git clone https://github.com/pmem/pmemkv-java.git
cd pmemkv-java
mvn install

### 1. Set Up YCSB
You need to clone the repository and compile **PmemKV module**.

git clone git://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn -pl site.ycsb:pmemkv-binding -am package

Optionally, you can use specific pmemkv version, by adding extra maven parameter: `-Dpmemkv.packageVersion=X.Y.Z`

### 2. Run the Workload
Before you can actually run the workload, you need to "load" the data first.

bin/ycsb.sh load pmemkv -P workloads/workloada -p pmemkv.engine=cmap -p pmemkv.dbpath=/path/to/pmem/pool -p pmemkv.dbsize=DB_SIZE

Then, you can run the workload:

bin/ycsb.sh run pmemkv -P workloads/workloada -p pmemkv.engine=cmap -p pmemkv.dbpath=/path/to/pmem/pool -p pmemkv.dbsize=DB_SIZE

## Configuration Options
Driver has several configuration options to parametrize engine, path, size and additional paramaters:

| Parameter | Meaning |
| --------------------- | -------------------------------------------------------------------------- |
| pmemkv.engine | pmemkv's storage engine - name of one of the supported engines |
| pmemkv.dbpath | Pool file path (to run workloads in) |
| pmemkv.dbsize | Pool file size (required to create database file, if it doesn't exist yet) |
| pmemkv.jsonconfigfile | Extra config parameters |

The default engine used in YCSB (if not defined otherwise) is **cmap**.

To check possible values for storage engine see
[pmemkv's documentation](https://github.com/pmem/pmemkv#storage-engines).
Note that each engine may require different path (a file or a directory)
and support various min. size - it's described in the mentioned documentation.

While most of engines require just path and size, it is possible to specify
additional config parameters. You have to pass these extra config parameters
within a file with a proper JSON Object. It is then passed to the PmemKV module
as a path to this file (e.g. `pmemkv.jsonconfigfile=/path/to/json/file`).

>Example of a proper JSON Object: `{"param1": "abc", "param2": 123}`
58 changes: 58 additions & 0 deletions pmemkv/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015-2021 YCSB contributors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>site.ycsb</groupId>
<artifactId>binding-parent</artifactId>
<version>0.18.0-SNAPSHOT</version>
<relativePath>../binding-parent</relativePath>
</parent>

<artifactId>pmemkv-binding</artifactId>
<name>PmemKV Binding</name>
<packaging>jar</packaging>

<properties>
<!-- extra parameters to allow easier building with pmemkv from sources -->
<pmemkv.packageName>pmemkv-root</pmemkv.packageName>
<pmemkv.packageVersion>1.2.0</pmemkv.packageVersion>
</properties>

<dependencies>
<dependency>
<groupId>site.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.pmem</groupId>
<artifactId>${pmemkv.packageName}</artifactId>
<version>${pmemkv.packageVersion}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 391ba30

Please sign in to comment.