Exception in thread "main" java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.List
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:190)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:172)
at redis.clients.jedis.Jedis.smembers(Jedis.java:1185)
at knoelab.classification.ELClassifier.process(ELClassifier.java:212)
at knoelab.classification.ELClassifier.process(ELClassifier.java:162)
at knoelab.classification.ELClassifier.classify(ELClassifier.java:78)
at knoelab.classification.ELClassifier.main(ELClassifier.java:112)
The line in my code which generates this a call to smembers() method. It is as follows
Set<String> result = jedis.smembers(key)
On redis-cli, when I do a smembers for that key, I would get an empty list.
If I replace jedis with shardedJedis (only 1 node) as follows -- shardedJedis.smembers(key), that exception does not arise.
What could be the issue here?
Regards,
Raghava.
In case of multiple threads, how is it possible to read a long instead of a list of strings?
Totally unrelated question -- if I use byte[] instead of Strings in Jedis, is it a lot quicker?