Introduce *scan with "string" cursor parameter to support unsigned long
cursor * overload all *scan method to change "int" cursor to "string" cursor * set @Deprecated and leave reason to deprecate and when to remove to current *scan method * modify unit tests to make it work with new *scan method
This commit is contained in:
@@ -1150,6 +1150,12 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(HINCRBYFLOAT, key, field, toByteArray(increment));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* This method is deprecated due to bug (scan cursor should be unsigned long)
|
||||
* And will be removed on next major release
|
||||
* @see https://github.com/xetorthio/jedis/issues/531
|
||||
*/
|
||||
public void scan(int cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(toByteArray(cursor));
|
||||
@@ -1157,6 +1163,12 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(SCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* This method is deprecated due to bug (scan cursor should be unsigned long)
|
||||
* And will be removed on next major release
|
||||
* @see https://github.com/xetorthio/jedis/issues/531
|
||||
*/
|
||||
public void hscan(final byte[] key, int cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
@@ -1164,7 +1176,13 @@ public class BinaryClient extends Connection {
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(HSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* This method is deprecated due to bug (scan cursor should be unsigned long)
|
||||
* And will be removed on next major release
|
||||
* @see https://github.com/xetorthio/jedis/issues/531
|
||||
*/
|
||||
public void sscan(final byte[] key, int cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
@@ -1172,7 +1190,13 @@ public class BinaryClient extends Connection {
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(SSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* This method is deprecated due to bug (scan cursor should be unsigned long)
|
||||
* And will be removed on next major release
|
||||
* @see https://github.com/xetorthio/jedis/issues/531
|
||||
*/
|
||||
public void zscan(final byte[] key, int cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
@@ -1180,6 +1204,37 @@ public class BinaryClient extends Connection {
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(ZSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void scan(final byte[] cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(cursor);
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(SCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void hscan(final byte[] key, final byte[] cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
args.add(cursor);
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(HSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void sscan(final byte[] key, final byte[] cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
args.add(cursor);
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(SSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void zscan(final byte[] key, final byte[] cursor, final ScanParams params) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
args.add(key);
|
||||
args.add(cursor);
|
||||
args.addAll(params.getParams());
|
||||
sendCommand(ZSCAN, args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void waitReplicas(int replicas, long timeout) {
|
||||
sendCommand(WAIT, toByteArray(replicas), toByteArray(timeout));
|
||||
|
||||
Reference in New Issue
Block a user