fix #553 : Overloading JedisCluster constructor to include poolConfig to be used internally for all JedisPool classes
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
|
||||
public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
@@ -25,12 +26,28 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
this(nodes, DEFAULT_TIMEOUT);
|
||||
}
|
||||
|
||||
public JedisCluster(Set<HostAndPort> jedisClusterNode, int timeout,
|
||||
public JedisCluster(Set<HostAndPort> nodes, int timeout,
|
||||
int maxRedirections) {
|
||||
this.connectionHandler = new JedisSlotBasedConnectionHandler(
|
||||
jedisClusterNode);
|
||||
this.timeout = timeout;
|
||||
this.maxRedirections = maxRedirections;
|
||||
this(nodes, timeout, maxRedirections,
|
||||
new GenericObjectPoolConfig());
|
||||
}
|
||||
|
||||
public JedisCluster(Set<HostAndPort> nodes,
|
||||
final GenericObjectPoolConfig poolConfig) {
|
||||
this(nodes, DEFAULT_TIMEOUT, DEFAULT_MAX_REDIRECTIONS, poolConfig);
|
||||
}
|
||||
|
||||
public JedisCluster(Set<HostAndPort> nodes, int timeout,
|
||||
final GenericObjectPoolConfig poolConfig) {
|
||||
this(nodes, timeout, DEFAULT_MAX_REDIRECTIONS, poolConfig);
|
||||
}
|
||||
|
||||
public JedisCluster(Set<HostAndPort> jedisClusterNode, int timeout,
|
||||
int maxRedirections, final GenericObjectPoolConfig poolConfig) {
|
||||
this.connectionHandler = new JedisSlotBasedConnectionHandler(
|
||||
jedisClusterNode, poolConfig);
|
||||
this.timeout = timeout;
|
||||
this.maxRedirections = maxRedirections;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user