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:
@@ -1396,6 +1396,12 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
return null;
|
||||
}
|
||||
|
||||
@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
|
||||
*/
|
||||
@Override
|
||||
public ScanResult<Entry<String, String>> hscan(final String key,
|
||||
final int cursor) {
|
||||
@@ -1408,6 +1414,12 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
}.run(null);
|
||||
}
|
||||
|
||||
@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
|
||||
*/
|
||||
@Override
|
||||
public ScanResult<String> sscan(final String key, final int cursor) {
|
||||
return new JedisClusterCommand<ScanResult<String>>(connectionHandler,
|
||||
@@ -1419,6 +1431,12 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
}.run(null);
|
||||
}
|
||||
|
||||
@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
|
||||
*/
|
||||
@Override
|
||||
public ScanResult<Tuple> zscan(final String key, final int cursor) {
|
||||
return new JedisClusterCommand<ScanResult<Tuple>>(connectionHandler,
|
||||
@@ -1429,4 +1447,38 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
}
|
||||
}.run(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanResult<Entry<String, String>> hscan(final String key,
|
||||
final String cursor) {
|
||||
return new JedisClusterCommand<ScanResult<Entry<String, String>>>(
|
||||
connectionHandler, timeout, maxRedirections) {
|
||||
@Override
|
||||
public ScanResult<Entry<String, String>> execute() {
|
||||
return connectionHandler.getConnection().hscan(key, cursor);
|
||||
}
|
||||
}.run(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanResult<String> sscan(final String key, final String cursor) {
|
||||
return new JedisClusterCommand<ScanResult<String>>(connectionHandler,
|
||||
timeout, maxRedirections) {
|
||||
@Override
|
||||
public ScanResult<String> execute() {
|
||||
return connectionHandler.getConnection().sscan(key, cursor);
|
||||
}
|
||||
}.run(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanResult<Tuple> zscan(final String key, final String cursor) {
|
||||
return new JedisClusterCommand<ScanResult<Tuple>>(connectionHandler,
|
||||
timeout, maxRedirections) {
|
||||
@Override
|
||||
public ScanResult<Tuple> execute() {
|
||||
return connectionHandler.getConnection().zscan(key, cursor);
|
||||
}
|
||||
}.run(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user