DATAREDIS-296 - Upgrade jedis to recent version.
Upgrading to latest jedis version 2.5.1. Added new conversion for Long to byte[] in JedisConverters to be able to convert long cursorIds to byte[]. Original pull request: #77.
This commit is contained in:
committed by
Christoph Strobl
parent
29e70b8cd8
commit
1831ae9db7
@@ -2975,11 +2975,8 @@ public class JedisConnection implements RedisConnection {
|
||||
|
||||
ScanParams params = prepareScanParams(options);
|
||||
|
||||
// TODO: use binary version of jedis.sscan (in v.2.4.3) to avoid potentially invalid representations.
|
||||
redis.clients.jedis.ScanResult<String> result = jedis.sscan(JedisConverters.toString(key),
|
||||
Long.toString(cursorId), params);
|
||||
return new ScanIteration<byte[]>(Long.valueOf(result.getStringCursor()), JedisConverters.stringListToByteList()
|
||||
.convert(result.getResult()));
|
||||
redis.clients.jedis.ScanResult<byte[]> result = jedis.sscan(key, JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<byte[]>(Long.valueOf(result.getStringCursor()), result.getResult());
|
||||
}
|
||||
}.open();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import redis.clients.util.SafeEncoder;
|
||||
*
|
||||
* @author Jennifer Hickey
|
||||
* @author Christoph Strobl
|
||||
* @author Thomas Darimont
|
||||
*/
|
||||
abstract public class JedisConverters extends Converters {
|
||||
|
||||
@@ -117,6 +118,10 @@ abstract public class JedisConverters extends Converters {
|
||||
return String.valueOf(source).getBytes();
|
||||
}
|
||||
|
||||
public static byte[] toBytes(Long source) {
|
||||
return String.valueOf(source).getBytes();
|
||||
}
|
||||
|
||||
public static String toString(byte[] source) {
|
||||
return source == null ? null : SafeEncoder.encode(source);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user