forked from brianfrankcooper/YCSB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[memcached] Added memcached binding.
The memcached support was extracted from PR brianfrankcooper#98 by @jbellis, with cleanups to bring it in line with current APIs and style guide. This PR also addresses issue brianfrankcooper#326.
- Loading branch information
Showing
9 changed files
with
574 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
|
||
## 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). | ||
|
||
### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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. | ||
|
||
# | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<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> |
Oops, something went wrong.