Make Jedis Cluster more likely to antirez's redis-rb-cluster
JedisClusterCommand * improvements on connection error handling ** if based on slot connection throws connection related exception, retry to random node ** if we retry with random node, but all nodes are unreachable, throw JedisConnectionException without retry ** try to release connection whether connection is broken or not * bug fix : if asking flag is on, and success this time, set asking flag to off JedisClusterConnectionHandler * have flexibility on initializing slots cache ** allow some nodes connection failure - skip ** if current node is success initializing slots cache, skip other nodes ** if current node failed to initialize slots cache, discard all discovered nodes and slots * set nodes if node does not exist in nodes ** it restricts JedisPool to replace - prevent IllegalStateException : Returned object not currently part of this pool JedisSlotBasedConnectionGuaranteedConnectionHandler * getConnection (random connection) ** check all connections by random sequence ** always return valid connection (able to ping-pong) ** throw exception if all connections are invalid * some refactoring
This commit is contained in:
@@ -27,7 +27,7 @@ public class JedisCluster implements JedisCommands, BasicCommands {
|
||||
|
||||
public JedisCluster(Set<HostAndPort> jedisClusterNode, int timeout,
|
||||
int maxRedirections) {
|
||||
this.connectionHandler = new JedisSlotBasedConnectionHandler(
|
||||
this.connectionHandler = new JedisSlotBasedConnectionGuaranteedConnectionHandler(
|
||||
jedisClusterNode);
|
||||
this.timeout = timeout;
|
||||
this.maxRedirections = maxRedirections;
|
||||
|
||||
Reference in New Issue
Block a user