-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
ClusterCommands.java
139 lines (100 loc) · 3.69 KB
/
ClusterCommands.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package redis.clients.jedis.commands;
import java.util.List;
import java.util.Map;
import redis.clients.jedis.args.ClusterResetType;
import redis.clients.jedis.args.ClusterFailoverOption;
import redis.clients.jedis.resps.ClusterShardInfo;
public interface ClusterCommands {
String asking();
String readonly();
String readwrite();
String clusterNodes();
String clusterMeet(String ip, int port);
String clusterAddSlots(int... slots);
String clusterDelSlots(int... slots);
String clusterInfo();
List<String> clusterGetKeysInSlot(int slot, int count);
List<byte[]> clusterGetKeysInSlotBinary(int slot, int count);
String clusterSetSlotNode(int slot, String nodeId);
String clusterSetSlotMigrating(int slot, String nodeId);
String clusterSetSlotImporting(int slot, String nodeId);
String clusterSetSlotStable(int slot);
String clusterForget(String nodeId);
String clusterFlushSlots();
long clusterKeySlot(String key);
long clusterCountFailureReports(String nodeId);
long clusterCountKeysInSlot(int slot);
String clusterSaveConfig();
/**
* Set a specific config epoch in a fresh node. It only works when the nodes' table
* of the node is empty or when the node current config epoch is zero.
* @param configEpoch
* @return OK
*/
String clusterSetConfigEpoch(long configEpoch);
/**
* Advance the cluster config epoch.
* @return BUMPED if the epoch was incremented, or STILL if the node already has the
* greatest config epoch in the cluster.
*/
String clusterBumpEpoch();
String clusterReplicate(String nodeId);
/**
* {@code CLUSTER SLAVES} command is deprecated since Redis 5.
*
* @deprecated Use {@link ClusterCommands#clusterReplicas(java.lang.String)}.
*/
@Deprecated
List<String> clusterSlaves(String nodeId);
List<String> clusterReplicas(String nodeId);
String clusterFailover();
String clusterFailover(ClusterFailoverOption failoverOption);
/**
* {@code CLUSTER SLOTS} command is deprecated since Redis 7.
*
* @deprecated Use {@link ClusterCommands#clusterShards()}.
*/
@Deprecated
List<Object> clusterSlots();
/**
* {@code CLUSTER SHARDS} returns details about the shards of the cluster.
* This command replaces the {@code CLUSTER SLOTS} command from Redis 7,
* by providing a more efficient and extensible representation of the cluster.
*
* @return a list of shards, with each shard containing two objects, 'slots' and 'nodes'.
* @see <a href="https://redis.io/commands/cluster-shards/">CLUSTER SHARDS</a>
*/
List<ClusterShardInfo> clusterShards();
String clusterReset();
/**
* {@code resetType} can be null for default behavior.
*
* @param resetType
* @return OK
*/
String clusterReset(ClusterResetType resetType);
String clusterMyId();
String clusterMyShardId();
/**
* return the information of all such peer links as an array, where each array element is a map that contains
* attributes and their values for an individual link.
*
* @return the information of all such peer links as an array
* @see <a href="https://redis.io/commands/cluster-links" >CLUSTET LINKS</a>
*/
List<Map<String, Object>> clusterLinks();
/**
* Takes a list of slot ranges (specified by start and end slots) to assign to the node
*
* @param ranges slots range
* @return OK if the command was successful. Otherwise, an error is returned.
*/
String clusterAddSlotsRange(int... ranges);
/**
* Takes a list of slot ranges (specified by start and end slots) to remove to the node.
*
* @param ranges slots range
* @return OK if the command was successful. Otherwise, an error is returned.
*/
String clusterDelSlotsRange(int... ranges);
}