Support CLUSTER SLOTS command
* CLUSTER SLOTS returns a Redis-formatted mapping from slot ranges to IP/Port pairs serving that slot range
* description link including output format
** e14829de30
* Unit test included
This commit is contained in:
@@ -1011,4 +1011,8 @@ public void clusterSetSlotStable(final int slot) {
|
||||
public void clusterFailover() {
|
||||
cluster(Protocol.CLUSTER_FAILOVER);
|
||||
}
|
||||
|
||||
public void clusterSlots() {
|
||||
cluster(Protocol.CLUSTER_SLOTS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,6 @@ public interface ClusterCommands {
|
||||
List<String> clusterSlaves(final String nodeId);
|
||||
|
||||
String clusterFailover();
|
||||
|
||||
List<Object> clusterSlots();
|
||||
}
|
||||
|
||||
@@ -3489,6 +3489,13 @@ public class Jedis extends BinaryJedis implements JedisCommands,
|
||||
client.clusterFailover();
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> clusterSlots() {
|
||||
checkIsInMulti();
|
||||
client.clusterSlots();
|
||||
return client.getObjectMultiBulkReply();
|
||||
}
|
||||
|
||||
public String asking() {
|
||||
checkIsInMulti();
|
||||
|
||||
@@ -59,6 +59,7 @@ public final class Protocol {
|
||||
public static final String CLUSTER_REPLICATE = "replicate";
|
||||
public static final String CLUSTER_SLAVES = "slaves";
|
||||
public static final String CLUSTER_FAILOVER = "failover";
|
||||
public static final String CLUSTER_SLOTS = "slots";
|
||||
public static final String PUBSUB_CHANNELS= "channels";
|
||||
public static final String PUBSUB_NUMSUB = "numsub";
|
||||
public static final String PUBSUB_NUM_PAT = "numpat";
|
||||
|
||||
Reference in New Issue
Block a user