Search code examples
ycsb

Cannot find or load main class com.yahoo.ycsb.Client


I'm trying to create a custom database binding, FooStore, for YCSB. I've compiled this via

mvn -pl com.yahoo.ycsb:foostore -am package

to a jar file, which I've tried to add to the classpath per Step 7

java -cp lib/foostore-0.13.0-SNAPSHOT.jar com.yahoo.ycsb.Client 
  -load -db com.yahoo.ycsb.db.FooStoreClient -P workloads/workloada

which I'm executing from the ycsb-0.12.0 directory (with my new jar file in the lib directory), which results in

Error: Could not find or load main class com.yahoo.ycsb.Client

Where should I be executing the java command from, and/or which jar(s) do I need to add to my classpath in order to fix this command?


Alternatively, how do I modify YCSB so that I can recompile it via mvn package and then simply execute ./bin/ycsb load foostore -P workloads/workloada


Solution

  • Have you tried to add a database keyword in ycsb?

    1. Maven gave you a ycsb-foostore-binding-0.13.0-SNAPSHOT.tar.gz. Untar it (in another directory).
    2. Edit ycsb-foostore-binding-0.13.0-SNAPSHOT/bin/ycsb and edit the DATABASES dictionary by adding a line like:

      "foostore" : "com.yahoo.ycsb.db.FooStoreClient",
      
    3. Run your custom YCSB:

      cd ycsb-foostore-binding-0.13.0-SNAPSHOT/
      /bin/ycsb load foostore -thread 1 -P workload/worloada -s