private static List<RedisServer> toRedisServersList(List<Map<String, String>> source) { List<RedisServer> servers = new ArrayList<RedisServer>(source.size()); for (Map<String, String> info : source) { servers.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return servers; }
private static List<RedisServer> toRedisServersList(List<Map<String, String>> source) { List<RedisServer> servers = new ArrayList<RedisServer>(source.size()); for (Map<String, String> info : source) { servers.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return servers; }
private static List<RedisServer> toRedisServersList(List<Map<String, String>> source) { List<RedisServer> servers = new ArrayList<RedisServer>(source.size()); for (Map<String, String> info : source) { servers.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return servers; }
private static List<RedisServer> toRedisServersList(List<Map<String, String>> source) { List<RedisServer> servers = new ArrayList<RedisServer>(source.size()); for (Map<String, String> info : source) { servers.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return servers; }
/** * @param source * @return * @since 1.4 */ public static List<RedisServer> toListOfRedisServer(List<Map<String, String>> source) { if (CollectionUtils.isEmpty(source)) { return Collections.emptyList(); } List<RedisServer> sentinels = new ArrayList<>(); for (Map<String, String> info : source) { sentinels.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return sentinels; }
/** * @param source List of Maps containing node details from SENTINEL SLAVES or SENTINEL MASTERS. May be empty or * {@literal null}. * @return List of {@link RedisServer}'s. List is empty if List of Maps is empty. * @since 1.5 */ public static List<RedisServer> toListOfRedisServer(List<Map<String, String>> source) { if (CollectionUtils.isEmpty(source)) { return Collections.emptyList(); } List<RedisServer> sentinels = new ArrayList<>(); for (Map<String, String> info : source) { sentinels.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return sentinels; }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { MasterSlaveEntry entry = getEntry(node); RFuture<List<String>> f = executorService.writeAsync(entry, StringCodec.INSTANCE, RedisCommands.CONFIG_GET, pattern); List<String> r = syncFuture(f); if (r != null) { return Converters.toProperties(r); } return null; }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.hasText(pattern, "Pattern must not be null or empty!"); return executeCommandOnSingleNode(client -> Converters.toProperties(client.configGet(pattern)), node).getValue(); }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode( (JedisClusterCommandCallback<Properties>) client -> Converters.toProperties(client.configGet(pattern)), node) .getValue(); }
@Override public Properties getConfig(String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); List<NodeResult<List<String>>> mapResult = connection.getClusterCommandExecutor() .executeCommandOnAllNodes((JedisClusterCommandCallback<List<String>>) client -> client.configGet(pattern)) .getResults(); List<String> result = new ArrayList<>(); for (NodeResult<List<String>> entry : mapResult) { String prefix = entry.getNode().asString(); int i = 0; for (String value : entry.getValue()) { result.add((i++ % 2 == 0 ? (prefix + ".") : "") + value); } } return Converters.toProperties(result); }
@Override public Properties getConfig(String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().configGet(pattern), Converters.listToPropertiesConverter())); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().configGet(pattern), Converters.listToPropertiesConverter())); return null; } return Converters.toProperties(connection.getJedis().configGet(pattern)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Properties getConfig(String pattern) { Assert.hasText(pattern, "Pattern must not be null or empty!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().configGet(pattern), Converters.mapToPropertiesConverter())); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().configGet(pattern), Converters.mapToPropertiesConverter())); return null; } return Converters.toProperties(getConnection().configGet(pattern)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
/** * @param source * @return * @since 1.4 */ public static List<RedisServer> toListOfRedisServer(List<Map<String, String>> source) { if (CollectionUtils.isEmpty(source)) { return Collections.emptyList(); } List<RedisServer> sentinels = new ArrayList<>(); for (Map<String, String> info : source) { sentinels.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return sentinels; }
/** * @param source * @return * @since 1.4 */ public static List<RedisServer> toListOfRedisServer(List<Map<String, String>> source) { if (CollectionUtils.isEmpty(source)) { return Collections.emptyList(); } List<RedisServer> sentinels = new ArrayList<>(); for (Map<String, String> info : source) { sentinels.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return sentinels; }
/** * @param source List of Maps containing node details from SENTINEL SLAVES or SENTINEL MASTERS. May be empty or * {@literal null}. * @return List of {@link RedisServer}'s. List is empty if List of Maps is empty. * @since 1.5 */ public static List<RedisServer> toListOfRedisServer(List<Map<String, String>> source) { if (CollectionUtils.isEmpty(source)) { return Collections.emptyList(); } List<RedisServer> sentinels = new ArrayList<>(); for (Map<String, String> info : source) { sentinels.add(RedisServer.newServerFrom(Converters.toProperties(info))); } return sentinels; }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.hasText(pattern, "Pattern must not be null or empty!"); return executeCommandOnSingleNode(client -> Converters.toProperties(client.configGet(pattern)), node).getValue(); }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.hasText(pattern, "Pattern must not be null or empty!"); return executeCommandOnSingleNode(client -> Converters.toProperties(client.configGet(pattern)), node).getValue(); }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); return connection.getClusterCommandExecutor().executeCommandOnSingleNode( (JedisClusterCommandCallback<Properties>) client -> Converters.toProperties(client.configGet(pattern)), node) .getValue(); }
@Override public Properties getConfig(RedisClusterNode node, String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); return connection.getClusterCommandExecutor().executeCommandOnSingleNode( (JedisClusterCommandCallback<Properties>) client -> Converters.toProperties(client.configGet(pattern)), node) .getValue(); }
@Override public Properties getConfig(String pattern) { Assert.notNull(pattern, "Pattern must not be null!"); List<NodeResult<List<String>>> mapResult = connection.getClusterCommandExecutor() .executeCommandOnAllNodes((JedisClusterCommandCallback<List<String>>) client -> client.configGet(pattern)) .getResults(); List<String> result = new ArrayList<>(); for (NodeResult<List<String>> entry : mapResult) { String prefix = entry.getNode().asString(); int i = 0; for (String value : entry.getValue()) { result.add((i++ % 2 == 0 ? (prefix + ".") : "") + value); } } return Converters.toProperties(result); }