Loading Memcached-Java-Load-Client

Hi all,

I am new in memcached, yscb and java-load-client. I am going to use Memcached-Java-Load-Client for evaluation of memcached. However, I have problem with loading and running load generator. The command is:
java -cp ./lib/memcached-2.6.jar:/usr/share/maven-repo/log4j/log4j/1.2.16/log4j-1.2.16.jar:/usr/share/java/slf4j-log4j12-1.6.4.jar:/usr/share/java/slf4j-api.jar:../Memcached-Java-Load-Client/build/ycsb.jar com.yahoo.ycsb.LoadGenerator -load -P workloads/workloadb

Although I run a memcached on my computer on port 11211, I got the below error message:

0 sec: 0 operations; 0 ops/sec

2013-08-13 01:15:30.954 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-08-13 01:15:30.956 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@57ccadea
Exception in thread "PooledThread-0" java.lang.NoSuchMethodError: net.spy.memcached.MemcachedClient.set(Ljava/lang/String;ILjava/lang/Object;)Lnet/spy/memcached/internal/OperationFuture;
at com.yahoo.ycsb.db.SpymemcachedClient.set(Unknown Source)
at com.yahoo.ycsb.memcached.MemcachedWrapper.set(Unknown Source)
at com.yahoo.ycsb.workloads.MemcachedCoreWorkload.doInsert(Unknown Source)
at com.yahoo.ycsb.client.ClientThreadPool$PooledThread.run(Unknown Source)

I should mention that I created the ycsb.jar by using the following command:
ant -Ddb=com.yahoo.ycsb.db.SpymemcachedClient -Dworkload=com.yahoo.ycsb.workloads.CoreWorkload dbcompile-memcached

and I separately downloaded memcached-2.6.jar and memcached-2.5.jar. I tried each version but got the same error.

Any suggestion?

Best Regards,
Saeid

Hi,

Thanks for the reply. I want to run Memcached-Java-Load-Client with memcached not with couchbase.

I have added spymemcached-2.9.1 to lib directory of Memcached-Java-Load-Client and compile it. Then I added slf4j-simple-1.7.5.jar and slf4j-api-1.7.5.jar into lib directory too.
But Still after attempting to load the client by
java -cp build/ycsb.jar:lib/slf4j-api-1.7.5.jar:lib/slf4j-simple-1.7.5.jar:lib/memcached-2.6.jar com.yahoo.ycsb.LoadGenerator -load -P workloads/workloadb

I got the error :

2013-08-13 21:44:23.049 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-08-13 21:44:23.052 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@f970646
Exception in thread "PooledThread-0" java.lang.NoSuchMethodError: net.spy.memcached.MemcachedClient.set(Ljava/lang/String;ILjava/lang/Object;)Lnet/spy/memcached/internal/OperationFuture;
at com.yahoo.ycsb.db.SpymemcachedClient.set(Unknown Source)
at com.yahoo.ycsb.memcached.MemcachedWrapper.set(Unknown Source)
at com.yahoo.ycsb.workloads.MemcachedCoreWorkload.doInsert(Unknown Source)
at com.yahoo.ycsb.client.ClientThreadPool$PooledThread.run(Unknown Source)
2013-08-13 21:44:23.053 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
Exception in thread "Thread-0" java.lang.IllegalThreadStateException
at java.lang.ThreadGroup.addUnstarted(ThreadGroup.java:864)
at java.lang.Thread.init(Thread.java:389)
at java.lang.Thread.(Thread.java:511)
at com.yahoo.ycsb.client.ClientThreadPool$PooledThread.(Unknown Source)
at com.yahoo.ycsb.client.ClientThreadPool.(Unknown Source)
at com.yahoo.ycsb.client.LoadThread.run(Unknown Source)
2013-08-13 21:44:23.054 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@6ce25f8a

Any help or suggestion will be appreciated.

Best Regards,
Saeid.

2 Answers

« Back to question.

Hi,

I see what you're doing, but let me point out the following:

- Use a recent YCSB and Spymemcached version! The pull request I pointed you to uses my fork of a recent version which uses our official SDK, that under the hood uses spymemcached so you can expect similar performance.

YCSB is a little tricky to work with, and its a maven based system, so won't get much out if it with using ant.

See the detailed instructions on this page here:

https://github.com/daschl/YCSB/tree/master/couchbase

This should be anything that you need in order to get started!

« Back to question.

Hi,

I'm not quite sure what are you trying to do and how you do it. In order to help you, I need some more information.

Also, please use spymemcached 2.9.1, which is the newest version.

If you want to use YCSB with Couchbase, look here, its already done: https://github.com/brianfrankcooper/YCSB/pull/136

Your message looks like that something is not on the classpath during execution. To make your life easier, just use maven or a maven-compliant build system (you use ant here, so stick with ivy).

Make sure everything is on the classpath!

Hi,

Thanks a lot for your reply.
I want to evaluate memcached by using Memcached-Java-Load-Client which uses YSCB to generate the get/set requests in the client side. This is what I have done:

I have installed memcached from the source. Then I installed the yscb by
git clone git://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn clean package

then I installed Memcached-Java-Load-Client from https://github.com/mikewied/Memcached-Java-Load-Client and installed it by
ant -Ddb=com.yahoo.ycsb.db.SpymemcachedClient -Dworkload=com.yahoo.ycsb.workloads.CoreWorkload dbcompile-memcached

finally when I tried to load a workload from Memcached-Java-Load-Client by
java -cp /home/saeid/software/memcached/Memcached-Java-Load-Client/build/classes/:~/software/memcached/YCSB/core/target/:./lib/memcached-2.6.jar:/usr/share/maven-repo/log4j/log4j/1.2.16/log4j-1.2.16.jar:/usr/share/java/slf4j-log4j12-1.6.4.jar:/usr/share/java/slf4j-api.jar:../Memcached-Java-Load-Client/build/ycsb.jar com.yahoo.ycsb.LoadGenerator -load -P workloads/workloadb

I got the mentioned error.

Also I have the classpath=/home/saeid/software/memcached/Memcached-Java-Load-Client/build/classes/:/home/saeid/software/memcached/YCSB/

It should be mentioned that since I have installed memcached from c source code I downloaded memcached-2.6.jar and memcached-2.5.jar manually and put them into /home/saeid/software/memcached/Memcached-Java-Load-Client/lib.

Please help me.

Best Regards,
Saeid