Skip to content

Commit

Permalink
[couchbase] Adding support for Couchbase.
Browse files Browse the repository at this point in the history
closes brianfrankcooper#136

Signed-off-by: Sean Busbey <[email protected]>
  • Loading branch information
daschl authored and busbey committed May 29, 2015
1 parent 4c90a73 commit 4d72b13
Show file tree
Hide file tree
Showing 5 changed files with 457 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/ycsb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ DATABASES = {
"nosqldb" : "com.yahoo.ycsb.db.NoSqlDbClient",
"orientdb" : "com.yahoo.ycsb.db.OrientDBClient",
"redis" : "com.yahoo.ycsb.db.RedisClient",
"voldemort" : "com.yahoo.ycsb.db.VoldemortClient",
"voldemort" : "com.yahoo.ycsb.db.VoldemortClient",
"couchbase" : "com.yahoo.ycsb.db.CouchbaseClient"
}

OPTIONS = {
Expand Down
50 changes: 50 additions & 0 deletions couchbase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Couchbase Driver for YCSB
This driver is a binding for the YCSB facilities to operate against a Couchbase Server cluster. It uses the official Couchbase Java SDK and provides a rich set of configuration options.

## Quickstart

### 1. Start Couchbase Server
You need to start a single node or a cluster to point the client at. Please see [http://couchbase.com](couchbase.com) for more details and instructions.

### 2. Set up YCSB
You need to clone the repository and compile everything.

```
git clone git://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn clean package
```

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

```
bin/ycsb load couchbase -s -P workloads/workloada
```

Then, you can run the workload:

```
bin/ycsb run couchbase -s -P workloads/workloada
```

Please see the general instructions in the `doc` folder if you are not sure how it all works. You can apply a property (as seen in the next section) like this:

```
bin/ycsb run couchbase -s -P workloads/workloada -p couchbase.useJson=false
```

## Configuration Options
Since no setup is the same and the goal of YCSB is to deliver realistic benchmarks, here are some setups that you can tune. Note that if you need more flexibility (let's say a custom transcoder), you still need to extend this driver and implement the facilities on your own.

You can set the following properties (with the default settings applied):

- couchbase.url=http://127.0.0.1:8091/pools => The connection URL from one server.
- couchbase.bucket=default => The bucket name to use.
- couchbase.password= => The password of the bucket.

- couchbase.checkFutures=true => If the futures should be inspected (makes ops sync).
- couchbase.persistTo=0 => Observe Persistence ("PersistTo" constraint).
- couchbase.replicateTo=0 => Observe Replication ("ReplicateTo" constraint).
- couchbase.json=true => Use json or java serialization as target format.

64 changes: 64 additions & 0 deletions couchbase/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>com.yahoo.ycsb</groupId>
<artifactId>root</artifactId>
<version>0.2.0-SNAPSHOT</version>
</parent>

<artifactId>couchbase-binding</artifactId>
<name>Couchbase Binding</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>couchbase</groupId>
<artifactId>couchbase-client</artifactId>
<version>${couchbase.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.2</version>
</dependency>
</dependencies>

<repositories>
<repository>
<id>couchbase</id>
<name>Couchbase Maven Repository</name>
<url>http://files.couchbase.com/maven2/</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.version}</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit 4d72b13

Please sign in to comment.