It seems it has nothing to do with pipelining,
whenever i execute the following line (with or without pipelining) i get a "ERR syntax error"
Set<Tuple> set = jedis.zrangeWithScores("mykey", -1, -1);
every jedis.z* method (returning a tuple) gives the same error. Is this a JEDIS bug? I can execute these lines with success on REDIS-CLI
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: ERR syntax error
at redis.clients.jedis.Protocol.processError(Protocol.java:59)
at redis.clients.jedis.Protocol.process(Protocol.java:66)
at redis.clients.jedis.Protocol.read(Protocol.java:131)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:199)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:192)
at redis.clients.jedis.Jedis.getTupledSet(Jedis.java:2290)
at redis.clients.jedis.Jedis.zrangeWithScores(Jedis.java:1572)
at com.oy.kaarun.kpm.crawler.test.RedisTest.main(RedisTest.java:44)
On Thursday, 28 February 2013 23:12:47 UTC+2, Onur GUNDURU wrote:
Hello,
Having difficulties with getting the a member with highest score from a sorted set and then removing this record from REDIS. Basically i'm trying to grab the highest scored player from the list. Following code produces the error below (marked with red line). It would be a great if someone could point me in the right direction.
Thanks a lot,
Best!
Onur
CODE
Jedis jedis = pool.getResource();
// create a pipeline
Pipeline p = jedis.pipelined();
// get player with top score
Response<Set<Tuple>> player = p.zrangeWithScores(setKey, 0, -1);
// now delete them from the redis frontier
jedis.zremrangeByRank(setKey, 0, -1);
// execute
p.sync();
// return pool
pool.returnResource(jedis);
EXCEPTION
Exception in thread "Thread-4" redis.clients.jedis.exceptions.JedisDataException: ERR syntax error
at redis.clients.jedis.Protocol.processError(Protocol.java:59)
at redis.clients.jedis.Protocol.process(Protocol.java:66)
at redis.clients.jedis.Protocol.read(Protocol.java:131)
at redis.clients.jedis.Connection.getIntegerReply(Connection.java:188)
at redis.clients.jedis.Jedis.zremrangeByRank(Jedis.java:2378)
...