-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[memcached] Added memcached binding. #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done (copied from |
||
|
|
||
| ### 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Copyright (c) 2015 YCSB contributors. All rights reserved. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copyright correct?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per discussion below, we're keeping it as |
||
| # | ||
| # 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 | ||
| 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> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.mdand 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?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.