Skip to content
Merged
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
4 changes: 4 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ in this case for the YCSB project.
This product includes software developed by
Yahoo! Inc. (www.yahoo.com)
Copyright (c) 2010 Yahoo! Inc. All rights reserved.

This product includes software developed by
Google Inc. (www.google.com)
Copyright (c) 2015 Google Inc. All rights reserved.
1 change: 1 addition & 0 deletions bin/ycsb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ DATABASES = {
"jdbc" : "com.yahoo.ycsb.db.JdbcDBClient",
"kudu" : "com.yahoo.ycsb.db.KuduYCSBClient",
"mapkeeper" : "com.yahoo.ycsb.db.MapKeeperClient",
"memcached" : "com.yahoo.ycsb.db.MemcachedClient",
"mongodb" : "com.yahoo.ycsb.db.MongoDbClient",
"mongodb-async": "com.yahoo.ycsb.db.AsyncMongoDbClient",
"nosqldb" : "com.yahoo.ycsb.db.NoSqlDbClient",
Expand Down
5 changes: 5 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ LICENSE file.
<artifactId>kudu-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>memcached-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>mongodb-binding</artifactId>
Expand Down
97 changes: 97 additions & 0 deletions memcached/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!--
Copyright (c) 2015 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.
-->

# YCSB Memcached binding

This section describes how to run YCSB on memcached.

## 1. Install and start memcached service on the host(s)

Debian / Ubuntu:

sudo apt-get install memcached

RedHat / CentOS:

sudo yum install memcached

## 2. Install Java and Maven

See step 2 in [`../mongodb/README.md`](../mongodb/README.md).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expand a bit on 1 and 2? Maybe just a link to a relevant memcached installation page, and possible a copy and paste of Java and Maven installation instructions from the mongodb module: https://github.com/brianfrankcooper/YCSB/tree/master/mongodb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for step 1. For step 2, it seems like this is binding-agnostic, so presumably it should be documented in a single place, and every binding can just point to it.

In fact, even step 5 is the same for everything, just substituting the binding is sufficient.

What are your thoughts about moving the "install Java / Maven" to a common place and linking to it? If so, where should it be located: top-level README, perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make progress on this PR, I've added a link to ../mongodb/README.md and refer the user to follow step 2 in that doc. Let's consider moving Java / Maven instructions to a common place as a separate PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be ok for now. I agree it should probably go into a single documented place. The top level README is an option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, happy to do that as a follow-up PR. Anything else you'd like to see as part of this PR, or is it good to go now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 523 moves Java + Maven instructions from MongoDB's README to the top-level README.

## 3. Set up YCSB

Git clone YCSB and compile:

git clone http://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn -pl com.yahoo.ycsb:memcached-binding -am clean package

## 4. Load data and run tests

Load the data:

./bin/ycsb load memcached -s -P workloads/workloada > outputLoad.txt

Run the workload test:

./bin/ycsb run memcached -s -P workloads/workloada > outputRun.txt

## 5. memcached Connection Parameters

A sample configuration is provided in
[`conf/memcached.properties`](conf/memcached.properties).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having an example conf file is great, in addition can you please document the memcached specific properties at the end of this README? The mongodb module also has a good example of how to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (copied from conf/memcache.properties).


### Required params

- `memcached.hosts`

This is a comma-separated list of hosts providing the memcached interface.
You can use IPs or hostnames. The port is optional and defaults to the
memcached standard port of `11211` if not specified.

### Optional params

- `memcached.shutdownTimeoutMillis`

Shutdown timeout in milliseconds.

- `memcached.objectExpirationTime`

Object expiration time for memcached; defaults to `Integer.MAX_VALUE`.

- `memcached.checkOperationStatus`

Whether to verify the success of each operation; defaults to true.

- `memcached.readBufferSize`

Read buffer size, in bytes.

- `memcached.opTimeoutMillis`

Operation timeout, in milliseconds.

- `memcached.failureMode`

What to do with failures; this is one of `net.spy.memcached.FailureMode` enum
values, which are currently: `Redistribute`, `Retry`, or `Cancel`.

You can set properties on the command line via `-p`, e.g.:

./bin/ycsb load memcached -s -P workloads/workloada \
-p "memcached.hosts=127.0.0.1" > outputLoad.txt
52 changes: 52 additions & 0 deletions memcached/conf/memcached.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) 2015 YCSB contributors. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion below, we're keeping it as Copyright (c) 2015 YCSB contributors. so yes, this is now (retroactively) correct.

#
# 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.

#
# Sample property file for Memcached Client

## Mandatory parameters

# A comma-separated list of memcached server endpoints, each being an IP or
# hostname with an optional port; the port defaults to the memcached-standard
# port of 11211 if not specified.
#
# memcached.hosts =

## Optional parameters

# Shutdown timeout in milliseconds.
#
# memcached.shutdownTimeoutMillis = 30000

# Object expiration time for memcached; defaults to `Integer.MAX_VALUE`.
#
# memcached.objectExpirationTime = 2147483647

# Whether to verify the success of each operation; defaults to true.
#
# memcached.checkOperationStatus = true

# Read buffer size, in bytes.
#
# memcached.readBufferSize = 3000000

# Operation timeout, in milliseconds.
#
# memcached.opTimeoutMillis = 60000

# What to do with failures; this is one of `net.spy.memcached.FailureMode` enum
# values, which are currently: `Redistribute`, `Retry`, or `Cancel`.
#
# memcached.failureMode = Redistribute
99 changes: 99 additions & 0 deletions memcached/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2014-2015 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>com.yahoo.ycsb</groupId>
<artifactId>binding-parent</artifactId>
<version>0.6.0-SNAPSHOT</version>
<relativePath>../binding-parent</relativePath>
</parent>

<artifactId>memcached-binding</artifactId>
<name>memcached binding</name>
<groupId>com.yahoo.ycsb</groupId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
<version>2.11.4</version>
</dependency>
</dependencies>

<build>
<plugins>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the checkstyle enforcement plugin, build and correct any checkstyle notices? Here is an example: https://github.com/brianfrankcooper/YCSB/blob/master/mongodb/pom.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.15</version>
<configuration>
<consoleOutput>true</consoleOutput>
<configLocation>../checkstyle.xml</configLocation>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
<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