зеркало из https://github.com/Azure/YCSB.git
[redis] add ability to specify jedis timeout on the command line (#1455)
This commit is contained in:
Родитель
af47d643ca
Коммит
0a43104985
|
@ -60,6 +60,7 @@ public class RedisClient extends DB {
|
|||
public static final String PORT_PROPERTY = "redis.port";
|
||||
public static final String PASSWORD_PROPERTY = "redis.password";
|
||||
public static final String CLUSTER_PROPERTY = "redis.cluster";
|
||||
public static final String TIMEOUT_PROPERTY = "redis.timeout";
|
||||
|
||||
public static final String INDEX_KEY = "_indices";
|
||||
|
||||
|
@ -81,7 +82,12 @@ public class RedisClient extends DB {
|
|||
jedisClusterNodes.add(new HostAndPort(host, port));
|
||||
jedis = new JedisCluster(jedisClusterNodes);
|
||||
} else {
|
||||
jedis = new Jedis(host, port);
|
||||
String redisTimeout = props.getProperty(TIMEOUT_PROPERTY);
|
||||
if (redisTimeout != null){
|
||||
jedis = new Jedis(host, port, Integer.parseInt(redisTimeout));
|
||||
} else {
|
||||
jedis = new Jedis(host, port);
|
||||
}
|
||||
((Jedis) jedis).connect();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче