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

gh-66 added gemfire.

parent 06300315
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ DATABASES = { ...@@ -20,6 +20,7 @@ DATABASES = {
"cassandra-7" : "com.yahoo.ycsb.db.CassandraClient7", "cassandra-7" : "com.yahoo.ycsb.db.CassandraClient7",
"cassandra-8" : "com.yahoo.ycsb.db.CassandraClient8", "cassandra-8" : "com.yahoo.ycsb.db.CassandraClient8",
"cassandra-10" : "com.yahoo.ycsb.db.CassandraClient10", "cassandra-10" : "com.yahoo.ycsb.db.CassandraClient10",
"gemfire" : "com.yahoo.ycsb.db.GemFireClient",
"hbase" : "com.yahoo.ycsb.db.HBaseClient", "hbase" : "com.yahoo.ycsb.db.HBaseClient",
"infinispan" : "com.yahoo.ycsb.db.InfinispanClient", "infinispan" : "com.yahoo.ycsb.db.InfinispanClient",
"jdbc" : "com.yahoo.ycsb.db.JdbcDBClient", "jdbc" : "com.yahoo.ycsb.db.JdbcDBClient",
...@@ -35,40 +36,37 @@ OPTIONS = { ...@@ -35,40 +36,37 @@ OPTIONS = {
"-target n" : "Target ops/sec (default: unthrottled)", "-target n" : "Target ops/sec (default: unthrottled)",
"-threads n" : "Number of client threads (default: 1)", "-threads n" : "Number of client threads (default: 1)",
} }
def usage(): def usage():
usage = "Usage: %s command database workload-file [options]" % sys.argv[0] print "Usage: %s command database workload-file [options]" % sys.argv[0]
print usage
print "Commands:" print "\nCommands:"
for command in sorted(COMMANDS.keys()): for command in sorted(COMMANDS.keys()):
print " {0:13} {1}".format(command, COMMANDS[command]["description"]) print " {0:13} {1}".format(command, COMMANDS[command]["description"])
print
print "Databases:" print "\nDatabases:"
for db in sorted(DATABASES.keys()): for db in sorted(DATABASES.keys()):
print " %s" % db print " %s" % db
print
print """Workload Files: print """\nWorkload Files:
There are various predefined workloads under workloads/ directory. There are various predefined workloads under workloads/ directory.
See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties
for the list of workload properties. for the list of workload properties."""
"""
print "Options:" print "\nOptions:"
for option in sorted(OPTIONS.keys()): for option in sorted(OPTIONS.keys()):
print " {0:13} {1}".format(option, OPTIONS[option]) print " {0:13} {1}".format(option, OPTIONS[option])
sys.exit(1) sys.exit(1)
def find_jars(dir, database): def find_jars(dir, database):
jars = [] jars = []
print database
for (dirpath, dirnames, filenames) in os.walk(dir): for (dirpath, dirnames, filenames) in os.walk(dir):
if dirpath.endswith("conf"):
jars.append(dirpath)
for filename in filenames: for filename in filenames:
print filename
if filename.endswith(".jar") and \ if filename.endswith(".jar") and \
filename.startswith("core") or filename.startswith(database.split("-")[0]): filename.startswith("core") or \
print filename filename.startswith(database.split("-")[0]):
jars.append(os.path.join(dirpath, filename)) jars.append(os.path.join(dirpath, filename))
return jars return jars
...@@ -76,39 +74,25 @@ def get_ycsb_home(): ...@@ -76,39 +74,25 @@ def get_ycsb_home():
dir = os.path.abspath(os.path.dirname(sys.argv[0])) dir = os.path.abspath(os.path.dirname(sys.argv[0]))
while "CHANGELOG" not in os.listdir(dir): while "CHANGELOG" not in os.listdir(dir):
dir = os.path.join(dir, os.path.pardir) dir = os.path.join(dir, os.path.pardir)
return os.path.abspath(dir ) return os.path.abspath(dir)
def get_command():
if len(sys.argv) < 2:
usage()
if sys.argv[1] not in COMMANDS:
print "ERROR: Command '%s' not found" % sys.argv[1]
usage()
return COMMANDS[sys.argv[1]]["command"]
def get_database():
if len(sys.argv) < 3:
usage()
if sys.argv[2] not in DATABASES:
print "ERROR: Database '%s' not found" % sys.argv[2]
usage()
return sys.argv[2], DATABASES[sys.argv[2]]
def get_workload(): if len(sys.argv) < 4:
if len(sys.argv) < 4: usage()
usage() if sys.argv[1] not in COMMANDS:
return sys.argv[3] print "ERROR: Command '%s' not found" % sys.argv[1]
usage()
def get_options(): if sys.argv[2] not in DATABASES:
return sys.argv[4:] print "ERROR: Database '%s' not found" % sys.argv[2]
usage()
ycsb_home = get_ycsb_home() ycsb_home = get_ycsb_home()
command = get_command() command = COMMANDS[sys.argv[1]]["command"]
database, db_classname = get_database() database = sys.argv[2]
workload = get_workload() db_classname = DATABASES[database]
options = get_options() workload = sys.argv[3]
options = sys.argv[4:]
ycsb_command = ["java", "-cp", ":".join(find_jars(ycsb_home, database)), \ ycsb_command = ["java", "-cp", ":".join(find_jars(ycsb_home, database)), \
"com.yahoo.ycsb.Client", command, "-db", db_classname, \ "com.yahoo.ycsb.Client", command, "-db", db_classname, \
"-P", workload] + options "-P", workload] + options
print " ".join(ycsb_command)
subprocess.call(ycsb_command) subprocess.call(ycsb_command)
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
<artifactId>gemfire</artifactId> <artifactId>gemfire</artifactId>
<version>6.6</version> <version>6.6</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${gemfire.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.ycsb</groupId> <groupId>org.apache.ycsb</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
......
...@@ -25,6 +25,10 @@ import com.yahoo.ycsb.StringByteIterator; ...@@ -25,6 +25,10 @@ import com.yahoo.ycsb.StringByteIterator;
import com.yahoo.ycsb.workloads.CoreWorkload; import com.yahoo.ycsb.workloads.CoreWorkload;
public class MapKeeperClient extends DB { public class MapKeeperClient extends DB {
private static final String HOST = "mapkeeper.host";
private static final String HOST_DEFAULT = "localhost";
private static final String PORT = "mapkeeper.port";
private static final String PORT_DEFAULT = "9090";
MapKeeper.Client c; MapKeeper.Client c;
boolean writeallfields; boolean writeallfields;
static boolean initteddb = false; static boolean initteddb = false;
...@@ -36,7 +40,9 @@ public class MapKeeperClient extends DB { ...@@ -36,7 +40,9 @@ public class MapKeeperClient extends DB {
} }
public void init() { public void init() {
TTransport tr = new TFramedTransport(new TSocket("localhost", 9090)); String host = getProperties().getProperty(HOST, HOST_DEFAULT);
int port = Integer.parseInt(getProperties().getProperty(PORT, PORT_DEFAULT));
TTransport tr = new TFramedTransport(new TSocket(host, port));
TProtocol proto = new TBinaryProtocol(tr); TProtocol proto = new TBinaryProtocol(tr);
c = new MapKeeper.Client(proto); c = new MapKeeper.Client(proto);
try { try {
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
<maven.assembly.version>2.2.1</maven.assembly.version> <maven.assembly.version>2.2.1</maven.assembly.version>
<hbase.version>0.90.5</hbase.version> <hbase.version>0.90.5</hbase.version>
<cassandra.version>0.7.0</cassandra.version> <cassandra.version>0.7.0</cassandra.version>
<gemfire.version>1.0.0.M3</gemfire.version>
<infinispan.version>7.1.0.CR1</infinispan.version> <infinispan.version>7.1.0.CR1</infinispan.version>
<openjpa.jdbc.version>2.1.1</openjpa.jdbc.version> <openjpa.jdbc.version>2.1.1</openjpa.jdbc.version>
<mapkeeper.version>1.0</mapkeeper.version> <mapkeeper.version>1.0</mapkeeper.version>
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
<module>core</module> <module>core</module>
<module>hbase</module> <module>hbase</module>
<module>cassandra</module> <module>cassandra</module>
<!--module>gemfire</module--> <module>gemfire</module>
<module>infinispan</module> <module>infinispan</module>
<module>jdbc</module> <module>jdbc</module>
<module>mapkeeper</module> <module>mapkeeper</module>
......
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