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 Jun 17, 2021
1 parent ce3eb9c commit b0111cc
Show file tree
Hide file tree
Showing 9 changed files with 542 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
70 changes: 70 additions & 0 deletions pmemkv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!--
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.1.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.dbsize=DB_SIZE -p pmemkv.dbpath=/path/to/pmem/pool

Then, you can run the workload:

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

## Configuration Options
Driver has a few configuration options to parametrize engine, path, and size using the following:

| Parameter | Meaning | Obligatory |
| :-----------: | -------------- | :--------: |
| pmemkv.engine | Storage engine | N |
| pmemkv.dbpath | Pool file path | Y |
| pmemkv.dbsize | Pool file size | Y |

To check possible values for storage engine see
[pmemkv's documentation](https://github.com/pmem/pmemkv#storage-engines).
The default engine used in YCSB (if not defined otherwise) is cmap.
Please take into consideration each engine may require different path and size
setting - as described in the mentioned documentation.
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.1.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 b0111cc

Please sign in to comment.