public class ClusterConnectionProvider extends Object implements ConnectionProvider
| Modifier and Type | Field and Description |
|---|---|
protected JedisClusterInfoCache |
cache |
| Constructor and Description |
|---|
ClusterConnectionProvider(Set<HostAndPort> clusterNodes,
JedisClientConfig clientConfig) |
ClusterConnectionProvider(Set<HostAndPort> clusterNodes,
JedisClientConfig clientConfig,
org.apache.commons.pool2.impl.GenericObjectPoolConfig<Connection> poolConfig) |
ClusterConnectionProvider(Set<HostAndPort> clusterNodes,
JedisClientConfig clientConfig,
org.apache.commons.pool2.impl.GenericObjectPoolConfig<Connection> poolConfig,
Duration topologyRefreshPeriod) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Connection |
getConnection() |
Connection |
getConnection(CommandArguments args) |
Connection |
getConnection(HostAndPort node) |
Connection |
getConnectionFromSlot(int slot) |
Map<String,ConnectionPool> |
getConnectionMap() |
HostAndPort |
getNode(int slot) |
Map<String,ConnectionPool> |
getNodes() |
void |
renewSlotCache() |
void |
renewSlotCache(Connection jedis) |
protected final JedisClusterInfoCache cache
public ClusterConnectionProvider(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfig)
public ClusterConnectionProvider(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfig, org.apache.commons.pool2.impl.GenericObjectPoolConfig<Connection> poolConfig)
public ClusterConnectionProvider(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfig, org.apache.commons.pool2.impl.GenericObjectPoolConfig<Connection> poolConfig, Duration topologyRefreshPeriod)
public void close()
close in interface AutoCloseablepublic void renewSlotCache()
public void renewSlotCache(Connection jedis)
public Map<String,ConnectionPool> getNodes()
public HostAndPort getNode(int slot)
public Connection getConnection(HostAndPort node)
public Connection getConnection(CommandArguments args)
getConnection in interface ConnectionProviderpublic Connection getConnection()
getConnection in interface ConnectionProviderpublic Connection getConnectionFromSlot(int slot)
public Map<String,ConnectionPool> getConnectionMap()
getConnectionMap in interface ConnectionProviderCopyright © 2024. All rights reserved.