Skip to content

Commit

Permalink
Add ability to pass ClusterConnectionProvider to JedisCluster (#3169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ham1255 authored Oct 20, 2022
1 parent e166fb5 commit 448207b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/JedisCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Set;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.executors.ClusterCommandExecutor;
import redis.clients.jedis.providers.ClusterConnectionProvider;

public class JedisCluster extends UnifiedJedis {

Expand Down Expand Up @@ -184,6 +185,11 @@ public JedisCluster(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfi
super(clusterNodes, clientConfig, maxAttempts, maxTotalRetriesDuration);
}

public JedisCluster(ClusterConnectionProvider provider, int maxAttempts,
Duration maxTotalRetriesDuration) {
super(provider, maxAttempts, maxTotalRetriesDuration);
}

public Map<String, ConnectionPool> getClusterNodes() {
return ((ClusterCommandExecutor) executor).provider.getNodes();
}
Expand Down

0 comments on commit 448207b

Please sign in to comment.