Several changes have been added to this commit:
- Add asking to cluster commands - Make jedis cluster return connection to original pool - Add tests for MOVED and ASK cluster responses - Refactor connection handler to recalculate connections based on slots This commit makes the first usable version of Jedis along with Redis Cluster
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package redis.clients.jedis.exceptions;
|
||||
|
||||
import redis.clients.jedis.HostAndPort;
|
||||
|
||||
public class JedisAskDataException extends JedisDataException {
|
||||
private static final long serialVersionUID = 3878126572474819403L;
|
||||
|
||||
public JedisAskDataException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
private HostAndPort targetNode;
|
||||
private int slot;
|
||||
|
||||
public JedisAskDataException(Throwable cause) {
|
||||
super(cause);
|
||||
@@ -14,4 +15,18 @@ public class JedisAskDataException extends JedisDataException {
|
||||
public JedisAskDataException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public JedisAskDataException(String message, HostAndPort targetHost, int slot) {
|
||||
super(message);
|
||||
this.targetNode = targetHost;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public HostAndPort getTargetNode() {
|
||||
return targetNode;
|
||||
}
|
||||
|
||||
public int getSlot() {
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user