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; }
/** * Creates a new {@link RedisServer} from the given properties. * * @param properties * @return */ public static RedisServer newServerFrom(Properties properties) { String host = properties.getProperty(INFO.HOST.key, "127.0.0.1"); int port = Integer.parseInt(properties.getProperty(INFO.PORT.key, "26379")); return new RedisServer(host, port, properties); }
/** * Creates a new {@link RedisServer} with the given {@code host}, {@code port} and {@code properties}. * * @param host must not be {@literal null} * @param port * @param properties may be {@literal null} */ public RedisServer(String host, int port, Properties properties) { super(host, port); this.properties = properties; String name = host + ":" + port; if (properties != null && properties.containsKey(INFO.NAME.key)) { name = get(INFO.NAME); } setName(name); }
/** * Get the number of connected replicas. * * @return * @since 2.1 */ public Long getNumberReplicas() { return getLongValueOf(INFO.NUMBER_SLAVES); }
public String getRunId() { return get(INFO.RUN_ID); }
public Long getNumberSlaves() { return getNumberReplicas(); }
public Long getLastOkPingReply() { return getLongValueOf(INFO.LAST_OK_PING_REPLY); }
public String getRoleReported() { return get(INFO.ROLE_REPORTED); }
/** * Creates a new {@link RedisServer} with the given {@code host}, {@code port} and {@code properties}. * * @param host must not be {@literal null} * @param port * @param properties may be {@literal null} */ public RedisServer(String host, int port, Properties properties) { super(host, port); this.properties = properties; String name = host + ":" + port; if (properties != null && properties.containsKey(INFO.NAME.key)) { name = get(INFO.NAME); } setName(name); }
public Long getNumberSlaves() { return getNumberReplicas(); }
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; }
public Long roleReportedTime() { return getLongValueOf(INFO.ROLE_REPORTED_TIME); }
public String getFlags() { return get(INFO.FLAGS); }
/** * Creates a new {@link RedisServer} with the given {@code host}, {@code port} and {@code properties}. * * @param host must not be {@literal null} * @param port * @param properties may be {@literal null} */ public RedisServer(String host, int port, Properties properties) { super(host, port); this.properties = properties; String name = host + ":" + port; if (properties != null && properties.containsKey(INFO.NAME.key)) { name = get(INFO.NAME); } setName(name); }
/** * Creates a new {@link RedisServer} from the given properties. * * @param properties * @return */ public static RedisServer newServerFrom(Properties properties) { String host = properties.getProperty(INFO.HOST.key, "127.0.0.1"); int port = Integer.parseInt(properties.getProperty(INFO.PORT.key, "26379")); return new RedisServer(host, port, properties); }
public Long getNumberSlaves() { return getNumberReplicas(); }
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; }