本文整理了Java中redis.clients.jedis.Jedis.clusterSlaves()
方法的一些代码示例,展示了Jedis.clusterSlaves()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.clusterSlaves()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:clusterSlaves
暂无
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Set<RedisClusterNode> clusterGetSlaves(RedisClusterNode master) {
Assert.notNull(master, "Master cannot be null!");
RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(master);
return JedisConverters.toSetOfRedisClusterNodes(clusterCommandExecutor
.executeCommandOnSingleNode(
(JedisClusterCommandCallback<List<String>>) client -> client.clusterSlaves(nodeToUse.getId()), master)
.getValue());
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Map<RedisClusterNode, Collection<RedisClusterNode>> clusterGetMasterSlaveMap() {
List<NodeResult<Collection<RedisClusterNode>>> nodeResults = clusterCommandExecutor
.executeCommandAsyncOnNodes((JedisClusterCommandCallback<Collection<RedisClusterNode>>) client -> {
// TODO: remove client.eval as soon as Jedis offers support for myid
return JedisConverters.toSetOfRedisClusterNodes(
client.clusterSlaves((String) client.eval("return redis.call('cluster', 'myid')", 0)));
}, topologyProvider.getTopology().getActiveMasterNodes()).getResults();
Map<RedisClusterNode, Collection<RedisClusterNode>> result = new LinkedHashMap<>();
for (NodeResult<Collection<RedisClusterNode>> nodeResult : nodeResults) {
result.put(nodeResult.getNode(), nodeResult.getValue());
}
return result;
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public List<String> clusterSlaves(String nodeId) {
return jedis.clusterSlaves(nodeId);
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public List<String> clusterSlaves(String nodeId) {
return jedis.clusterSlaves(nodeId);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public List<String> clusterSlaves(String nodeId) {
String command = "clusterSlaves";
return instrumented(command, () -> delegated.clusterSlaves(nodeId));
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public List<String> clusterSlaves(String nodeId) {
Jedis jedis = getJedis();
try {
return jedis.clusterSlaves(nodeId);
} finally {Streams.safeClose(jedis);}
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public Set<RedisClusterNode> clusterGetSlaves(RedisClusterNode master) {
Assert.notNull(master, "Master cannot be null!");
RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(master);
return JedisConverters.toSetOfRedisClusterNodes(clusterCommandExecutor
.executeCommandOnSingleNode(
(JedisClusterCommandCallback<List<String>>) client -> client.clusterSlaves(nodeToUse.getId()), master)
.getValue());
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Set<RedisClusterNode> clusterGetSlaves(RedisClusterNode master) {
Assert.notNull(master, "Master cannot be null!");
RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(master);
return JedisConverters.toSetOfRedisClusterNodes(clusterCommandExecutor
.executeCommandOnSingleNode(
(JedisClusterCommandCallback<List<String>>) client -> client.clusterSlaves(nodeToUse.getId()), master)
.getValue());
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public Map<RedisClusterNode, Collection<RedisClusterNode>> clusterGetMasterSlaveMap() {
List<NodeResult<Collection<RedisClusterNode>>> nodeResults = clusterCommandExecutor
.executeCommandAsyncOnNodes((JedisClusterCommandCallback<Collection<RedisClusterNode>>) client -> {
// TODO: remove client.eval as soon as Jedis offers support for myid
return JedisConverters.toSetOfRedisClusterNodes(
client.clusterSlaves((String) client.eval("return redis.call('cluster', 'myid')", 0)));
}, topologyProvider.getTopology().getActiveMasterNodes()).getResults();
Map<RedisClusterNode, Collection<RedisClusterNode>> result = new LinkedHashMap<>();
for (NodeResult<Collection<RedisClusterNode>> nodeResult : nodeResults) {
result.put(nodeResult.getNode(), nodeResult.getValue());
}
return result;
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Map<RedisClusterNode, Collection<RedisClusterNode>> clusterGetMasterSlaveMap() {
List<NodeResult<Collection<RedisClusterNode>>> nodeResults = clusterCommandExecutor
.executeCommandAsyncOnNodes((JedisClusterCommandCallback<Collection<RedisClusterNode>>) client -> {
// TODO: remove client.eval as soon as Jedis offers support for myid
return JedisConverters.toSetOfRedisClusterNodes(
client.clusterSlaves((String) client.eval("return redis.call('cluster', 'myid')", 0)));
}, topologyProvider.getTopology().getActiveMasterNodes()).getResults();
Map<RedisClusterNode, Collection<RedisClusterNode>> result = new LinkedHashMap<>();
for (NodeResult<Collection<RedisClusterNode>> nodeResult : nodeResults) {
result.put(nodeResult.getNode(), nodeResult.getValue());
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!