Add JedisClusterCommand and updated code to use it respectively
This commit is contained in:
23
src/main/java/redis/clients/jedis/JedisClusterCommand.java
Normal file
23
src/main/java/redis/clients/jedis/JedisClusterCommand.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import redis.clients.jedis.exceptions.JedisMovedDataException;
|
||||
|
||||
public abstract class JedisClusterCommand<T> {
|
||||
|
||||
private JedisClusterConnectionHandler connectionHandler;
|
||||
|
||||
public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler) {
|
||||
this.connectionHandler = connectionHandler;
|
||||
}
|
||||
|
||||
public abstract T execute();
|
||||
|
||||
public T run() {
|
||||
try {
|
||||
return execute();
|
||||
} catch (JedisMovedDataException e) {
|
||||
//TODO: Retry here
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user