public final class JedisClusterClusterOperations extends AbstractClusterOperations<JedisClusterClient>
JedisRedisOperations.AbstractJedisCommand<C extends JedisRedisClient,R>, JedisRedisOperations.JedisClusterCommand<R>, JedisRedisOperations.JedisCommand<R>, JedisRedisOperations.JedisSentinelCommand<R>
client
logger
构造器和说明 |
---|
JedisClusterClusterOperations(JedisClusterClient client) |
限定符和类型 | 方法和说明 |
---|---|
com.buession.lang.Status |
asking()
When a cluster client receives an -ASK redirect,
the ASKING command is sent to the target node followed by the command which was redirected.
|
com.buession.lang.Status |
clusterAddSlots(int... slots)
把一组 hash slots 分配给接收命令的节点
详情说明 http://www.redis.cn/commands/cluster-addslots.html
|
com.buession.lang.KeyValue<BumpEpoch,Integer> |
clusterBumpEpoch()
The CLUSTER BUMPEPOCH command triggers an increment to the cluster’s config epoch from the connected node.
|
Integer |
clusterCountFailureReports(byte[] nodeId)
The command returns the number of failure reports for the specified node
详情说明 https://redis.io/commands/cluster-count-failure-reports/
|
Integer |
clusterCountFailureReports(String nodeId)
The command returns the number of failure reports for the specified node
详情说明 https://redis.io/commands/cluster-count-failure-reports/
|
Long |
clusterCountKeysInSlot(int slot)
返回连接节点负责的指定 hash slot 的 key 的数量;
只查询连接节点的数据集,所以如果连接节点指派到该 hash slot 会返回 0
详情说明 http://www.redis.cn/commands/cluster-countkeysinslot.html
|
com.buession.lang.Status |
clusterDelSlots(int... slots)
使一个特定的 Redis Cluster 节点去忘记一个主节点正在负责的哈希槽
详情说明 http://www.redis.cn/commands/cluster-delslots.html
|
com.buession.lang.Status |
clusterFailover(ClusterFailoverOption clusterFailoverOption)
让 slave 节点进行一次人工故障切换
详情说明 http://www.redis.cn/commands/cluster-failover.html
|
com.buession.lang.Status |
clusterFlushSlots()
Deletes all slots from a node
详情说明 https://redis.io/commands/cluster-flushslots/
|
com.buession.lang.Status |
clusterForget(String nodeId)
从收到命令的 Redis 群集节点的节点信息列表中移除指定ID的节点
详情说明 http://www.redis.cn/commands/cluster-forget.html
|
List<String> |
clusterGetKeysInSlot(int slot,
long count)
返回存储在连接节点的指定 hash slot 里面的 key 的列表
详情说明 http://www.redis.cn/commands/cluster-getkeysinslot.html
|
ClusterInfo |
clusterInfo()
返回 Redis 集群信息
详情说明 http://www.redis.cn/commands/cluster-info.html
|
Long |
clusterKeySlot(String key)
返回一个整数,用于标识指定键所散列到的哈希槽
详情说明 http://www.redis.cn/commands/cluster-keyslot.html
|
com.buession.lang.Status |
clusterMeet(String ip,
int port)
用来连接不同的开启集群支持的 Redis 节点,以进入工作集群
详情说明 http://www.redis.cn/commands/cluster-meet.html
|
String |
clusterMyId()
返回当前节点 Id
详情说明 https://redis.io/commands/cluster-myid/
|
List<ClusterRedisNode> |
clusterNodes()
当前连接节点所属集群的配置信息
详情说明 http://www.redis.cn/commands/cluster-nodes.html
|
List<ClusterRedisNode> |
clusterReplicas(String nodeId)
列出指定主节点的辅助副本节点
详情说明 http://www.redis.cn/commands/cluster-replicas.html
|
com.buession.lang.Status |
clusterReplicate(String nodeId)
重新配置一个节点成为指定master的salve节点
详情说明 http://www.redis.cn/commands/cluster-replicate.html
|
com.buession.lang.Status |
clusterReset(ClusterResetOption clusterResetOption)
Reset 集群
详情说明 http://www.redis.cn/commands/cluster-reset.html
|
com.buession.lang.Status |
clusterSaveConfig()
强制保存配置 nodes.conf 至磁盘
详情说明 http://www.redis.cn/commands/cluster-saveconfig.html
|
com.buession.lang.Status |
clusterSetConfigEpoch(long configEpoch)
为一个全新的节点设置指定的 config epoch,仅在如下情况下有效:
1)节点的节点信息表为空
2)节点的当前 config epoch 为 0
详情说明 http://www.redis.cn/commands/cluster-set-config-epoch.html
|
com.buession.lang.Status |
clusterSetSlot(int slot,
ClusterSetSlotOption setSlotOption,
String nodeId)
根据如下子命令选项,修改接受节点中哈希槽的状态
详情说明 http://www.redis.cn/commands/cluster-setslot.html
|
List<ClusterRedisNode> |
clusterSlaves(String nodeId)
列出指定 master 节点所有 slave 节点
详情说明 http://www.redis.cn/commands/cluster-slaves.html
|
List<ClusterSlot> |
clusterSlots()
返回哈希槽和 Redis 实例映射关系
详情说明 http://www.redis.cn/commands/cluster-slots.html
|
com.buession.lang.Status |
readOnly()
开启与 Redis Cluster 从节点连接的读请求,通过该命令将从节点设置为只读模式
详情说明 http://www.redis.cn/commands/readonly.html
|
com.buession.lang.Status |
readWrite()
将连接的只读模式重置为读写模式
详情说明 http://www.redis.cn/commands/readwrite.html
|
clusterForget, clusterKeySlot, clusterReplicas, clusterReplicate, clusterReset, clusterSetSlot, clusterSlaves
public JedisClusterClusterOperations(JedisClusterClient client)
public String clusterMyId()
ClusterCommands
public com.buession.lang.Status clusterAddSlots(int... slots)
ClusterCommands
slots
- hash slotspublic List<ClusterSlot> clusterSlots()
ClusterCommands
public Integer clusterCountFailureReports(String nodeId)
ClusterCommands
详情说明 https://redis.io/commands/cluster-count-failure-reports/
nodeId
- 节点 Idpublic Integer clusterCountFailureReports(byte[] nodeId)
ClusterCommands
详情说明 https://redis.io/commands/cluster-count-failure-reports/
nodeId
- 节点 Idpublic Long clusterCountKeysInSlot(int slot)
ClusterCommands
详情说明 http://www.redis.cn/commands/cluster-countkeysinslot.html
slot
- hash slotpublic com.buession.lang.Status clusterDelSlots(int... slots)
ClusterCommands
slots
- hash slotspublic com.buession.lang.Status clusterFlushSlots()
ClusterCommands
public com.buession.lang.Status clusterFailover(ClusterFailoverOption clusterFailoverOption)
ClusterCommands
clusterFailoverOption
- 切换选项public com.buession.lang.Status clusterForget(String nodeId)
ClusterCommands
nodeId
- 节点 Idpublic List<String> clusterGetKeysInSlot(int slot, long count)
ClusterCommands
详情说明 http://www.redis.cn/commands/cluster-getkeysinslot.html
slot
- hash slotcount
- 返回数量public Long clusterKeySlot(String key)
ClusterCommands
key
- Keypublic ClusterInfo clusterInfo()
ClusterCommands
public com.buession.lang.Status clusterMeet(String ip, int port)
ClusterCommands
ip
- Redis 集群节点 IPport
- Redis 集群节点端口public List<ClusterRedisNode> clusterNodes()
ClusterCommands
public List<ClusterRedisNode> clusterSlaves(String nodeId)
ClusterCommands
nodeId
- Master 节点 Idpublic List<ClusterRedisNode> clusterReplicas(String nodeId)
ClusterCommands
nodeId
- 节点 Idpublic com.buession.lang.Status clusterReplicate(String nodeId)
ClusterCommands
nodeId
- 节点 Idpublic com.buession.lang.Status clusterReset(ClusterResetOption clusterResetOption)
ClusterCommands
clusterResetOption
- Reset 类型public com.buession.lang.Status clusterSaveConfig()
ClusterCommands
public com.buession.lang.Status clusterSetConfigEpoch(long configEpoch)
ClusterCommands
详情说明 http://www.redis.cn/commands/cluster-set-config-epoch.html
configEpoch
- Config Epochpublic com.buession.lang.KeyValue<BumpEpoch,Integer> clusterBumpEpoch()
ClusterCommands
BumpEpoch
public com.buession.lang.Status clusterSetSlot(int slot, ClusterSetSlotOption setSlotOption, String nodeId)
ClusterCommands
slot
- hash slotsetSlotOption
- 命令选项 ClusterSetSlotOption
nodeId
- 节点 Idpublic com.buession.lang.Status asking()
ClusterCommands
public com.buession.lang.Status readWrite()
ClusterCommands
public com.buession.lang.Status readOnly()
ClusterCommands
Copyright © 2022 buession.com Inc.. All rights reserved.