Skip to content
Snippets Groups Projects
Commit c2aadd36 authored by m1ch1's avatar m1ch1
Browse files

Merge branch 'master' of github.com:brianfrankcooper/YCSB

parents e52a4fd5 b99c7f08
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
- gh-59 Cassandra 1.0.6 (akkumar)
- gh-62 Oracle NoSQL Database Client (y-namiki)
- gh-64 Mavenisation of YCSB with a (tar ball) distribution packager (hariprasad-k)
- gh-65 Patch for improving the MongoDB Client (singhsiddharth)
0.1.3 - 10/26/10
......
Yahoo! Cloud System Benchmark (YCSB)
====================================
Links
-----
http://wiki.github.com/brianfrankcooper/YCSB/
http://research.yahoo.com/Web_Information_Management/YCSB
ycsb-users@yahoogroups.com
Getting Started
---------------
Overview
========
1. Download the latest release of YCSB:
It is difficult to decide which system is right for your application,
partially because the features differ between systems, and partially
because there is not an easy way to compare the performance of one
system versus another.
wget https://github.com/downloads/brianfrankcooper/YCSB/ycsb-0.1.4.tar.gz
tar xfvz ycsb-0.1.4
cd ycsb-0.1.4
The goal of the YCSB project is to develop a framework and common set
of workloads for evaluating the performance of different "key-value"
and "cloud" serving stores. The project comprises two things:
2. Set up a database to benchmark. There is a README file under each binding
directory.
* The YCSB Client, an extensible workload generator
3. Run YCSB command.
* The Core workloads, a set of workload scenarios to be executed by
the generator
bin/ycsb load basic workloads/workloada
bin/ycsb run basic workloads/workloada
Although the core workloads provide a well rounded picture of a
system's performance, the Client is extensible so that you can define
new and different workloads to examine system aspects, or application
scenarios, not adequately covered by the core workload. Similarly, the
Client is extensible to support benchmarking different
databases. Although we include sample code for benchmarking HBase and
Cassandra, it is straightforward to write a new interface layer to
benchmark your favorite database.
A common use of the tool is to benchmark multiple systems and compare
them. For example, you can install multiple systems on the same
hardward configuration, and run the same workloads against each
system. Then you can plot the performance of each system (for example,
as latency versus throughput curves) to see when one system does
better than another.
Detailed information about using the benchmark is available in the
doc/index.html file.
Running the `ycsb` command without any argument will print the usage. See
https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties for the list
of available workload properties.
......@@ -43,7 +43,7 @@ def usage():
print "\nCommands:"
for command in sorted(COMMANDS.keys()):
print " {0:13} {1}".format(command, COMMANDS[command]["description"])
print " %s %s" % (command.ljust(13), COMMANDS[command]["description"])
print "\nDatabases:"
for db in sorted(DATABASES.keys()):
......@@ -56,7 +56,7 @@ def usage():
print "\nOptions:"
for option in sorted(OPTIONS.keys()):
print " {0:13} {1}".format(option, OPTIONS[option])
print " %s %s" % (option.ljust(13), OPTIONS[option])
sys.exit(1)
def find_jars(dir, database):
......
File moved
......@@ -5,19 +5,42 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>..</directory>
<outputDirectory>.</outputDirectory>
<fileMode>0644</fileMode>
<includes>
<include>README</include>
<include>CHANGELOG</include>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>../bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../workloads</directory>
<outputDirectory>workloads</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
</fileSets>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includeSubModules>true</includeSubModules>
<sources>
<includeModuleDirectory>false</includeModuleDirectory>
<includeModuleDirectory>true</includeModuleDirectory>
<fileSets>
<fileSet>
<directory>../</directory>
<outputDirectory>.</outputDirectory>
<includes>
<directory>.</directory>
<fileMode>0644</fileMode>
<includes>
<include>README</include>
<include>CHANGELOG</include>
</includes>
</fileSet>
<fileSet>
......@@ -25,16 +48,6 @@
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/resources/workloads</directory>
<outputDirectory>workloads</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<outputDirectory>lib</outputDirectory>
<directory>target</directory>
......
......@@ -27,6 +27,7 @@ import com.mongodb.DBObject;
import com.mongodb.Mongo;
import com.mongodb.ServerAddress;
import com.mongodb.WriteConcern;
import com.mongodb.WriteResult;
import com.yahoo.ycsb.DB;
import com.yahoo.ycsb.DBException;
......@@ -87,6 +88,7 @@ public class MongoDbClient extends DB {
System.err.println(
"Could not initialize MongoDB connection pool for Loader: "
+ e1.toString());
e1.printStackTrace();
return;
}
......@@ -107,15 +109,8 @@ public class MongoDbClient extends DB {
db.requestStart();
DBCollection collection = db.getCollection(table);
DBObject q = new BasicDBObject().append("_id", key);
if (writeConcern.equals(WriteConcern.SAFE)) {
q.put("$atomic", true);
}
collection.remove(q);
// see if record was deleted
DBObject errors = db.getLastError();
return ((Integer) errors.get("n")) == 1 ? 0 : 1;
WriteResult res = collection.remove(q, writeConcern);
return res.getN() == 1 ? 0 : 1;
} catch (Exception e) {
System.err.println(e.toString());
return 1;
......@@ -149,17 +144,10 @@ public class MongoDbClient extends DB {
DBCollection collection = db.getCollection(table);
DBObject r = new BasicDBObject().append("_id", key);
for(String k: values.keySet()) {
r.put(k, values.get(k).toString());
r.put(k, values.get(k).toArray());
}
collection.setWriteConcern(writeConcern);
collection.insert(r);
// determine if record was inserted, does not seem to return
// n=<records affected> for insert
DBObject errors = db.getLastError();
return ((Double) errors.get("ok") == 1.0) && errors.get("err") == null ? 0 : 1;
WriteResult res = collection.insert(r,writeConcern);
return res.getError() == null ? 0 : 1;
} catch (Exception e) {
System.err.println(e.toString());
return 1;
......@@ -244,23 +232,15 @@ public class MongoDbClient extends DB {
DBObject u = new BasicDBObject();
DBObject fieldsToSet = new BasicDBObject();
Iterator<String> keys = values.keySet().iterator();
String tmpKey = null, tmpVal = null;
while (keys.hasNext()) {
tmpKey = keys.next();
tmpVal = values.get(tmpKey).toString();
fieldsToSet.put(tmpKey, tmpVal);
String tmpKey = keys.next();
fieldsToSet.put(tmpKey, values.get(tmpKey).toArray());
}
u.put("$set", fieldsToSet);
collection.setWriteConcern(writeConcern);
collection.update(q, u);
// determine if record was inserted
DBObject errors = db.getLastError();
return (Integer) errors.get("n") == 1 ? 0 : 1;
WriteResult res = collection.update(q, u, false, false,
writeConcern);
return res.getN() == 1 ? 0 : 1;
} catch (Exception e) {
System.err.println(e.toString());
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment