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