From be741e76fbee70f96de50d68f7406d15d5f91ad9 Mon Sep 17 00:00:00 2001 From: Govind Kamat Date: Wed, 17 Jun 2015 17:15:30 -0700 Subject: [PATCH 1/2] [scripts] Add only the conf directory for the relevant binding to the classpath, rather than all of them. --- bin/ycsb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ycsb b/bin/ycsb index c19f100002..42d78f55d0 100755 --- a/bin/ycsb +++ b/bin/ycsb @@ -91,7 +91,7 @@ def usage(): def find_jars(dir, database): jars = [] for (dirpath, dirnames, filenames) in os.walk(dir): - if dirpath.endswith("conf"): + if dirpath.endswith(os.path.join(database + "-binding", "conf")): jars.append(dirpath) for filename in filenames: if filename.endswith(".jar") and \ From 372d2305855ce47395fe2f486cb49b70142afbed Mon Sep 17 00:00:00 2001 From: Govind Kamat Date: Fri, 19 Jun 2015 17:32:17 -0700 Subject: [PATCH 2/2] [scripts] Include only the binding-specific jars and conf directory in the classpath, rather than all of them. --- bin/ycsb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/ycsb b/bin/ycsb index 42d78f55d0..d28c3f8040 100755 --- a/bin/ycsb +++ b/bin/ycsb @@ -91,13 +91,8 @@ def usage(): def find_jars(dir, database): jars = [] for (dirpath, dirnames, filenames) in os.walk(dir): - if dirpath.endswith(os.path.join(database + "-binding", "conf")): - jars.append(dirpath) for filename in filenames: - if filename.endswith(".jar") and \ - (filename.startswith("core") or \ - filename.startswith(database.split("-")[0]) or \ - not "binding" in filename): + if filename.endswith(".jar"): jars.append(os.path.join(dirpath, filename)) return jars @@ -134,7 +129,11 @@ def main(): db_classname = DATABASES[args.database] command = COMMANDS[args.command]["command"] main_classname = COMMANDS[args.command]["main"] - classpath = os.pathsep.join(find_jars(ycsb_home, args.database)) + db_dir = os.path.join(ycsb_home, args.database + "-binding") + cp = [ os.path.join(db_dir, "conf") ] + cp.extend(find_jars(os.path.join(ycsb_home, "lib"), args.database)) + cp.extend(find_jars(os.path.join(db_dir, "lib"), args.database)) + classpath = os.pathsep.join(cp) if args.classpath: classpath = os.pathsep.join([args.classpath, classpath])