Package org.redisson.cluster
Class ClusterConnectionManager
- java.lang.Object
-
- org.redisson.connection.MasterSlaveConnectionManager
-
- org.redisson.cluster.ClusterConnectionManager
-
- All Implemented Interfaces:
ConnectionManager
public class ClusterConnectionManager extends MasterSlaveConnectionManager
- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.connection.MasterSlaveConnectionManager
codec, config, dnsMonitor, DUMMY_TIMEOUT, group, id, MAX_SLOT, resolverGroup, singleSlotRange, socketChannelClass, subscribeService
-
-
Constructor Summary
Constructors Constructor Description ClusterConnectionManager(ClusterServersConfig cfg, Config config, UUID id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RedisURI
applyNatMap(RedisURI address)
int
calcSlot(byte[] key)
int
calcSlot(String key)
protected RFuture<RedisClient>
changeMaster(int slot, RedisURI address)
protected RedisClientConfig
createRedisConfig(NodeType type, RedisURI address, int timeout, int commandTimeout, String sslHostname)
MasterSlaveEntry
getEntry(int slot)
MasterSlaveEntry
getEntry(InetSocketAddress address)
MasterSlaveEntry
getEntry(RedisClient redisClient)
protected MasterSlaveEntry
getEntry(RedisURI addr)
Collection<MasterSlaveEntry>
getEntrySet()
RedisURI
getLastClusterNode()
boolean
isClusterMode()
void
shutdown()
-
Methods inherited from class org.redisson.connection.MasterSlaveConnectionManager
closeNodeConnection, closeNodeConnections, connectionReadOp, connectionWriteOp, connectToNode, connectToNode, create, createClient, createClient, createClient, createNodeNotFoundException, disconnectNode, getCfg, getCodec, getConfig, getConnectionEventsHub, getConnectionWatcher, getDisconnectedNodes, getElementsSubscribeService, getEntry, getExecutor, getGroup, getId, getShutdownLatch, getShutdownPromise, getSubscribeService, initSingleEntry, initTimer, isShutdown, isShuttingDown, newTimeout, releaseRead, releaseWrite, shutdown, startDNSMonitoring, stopThreads
-
-
-
-
Constructor Detail
-
ClusterConnectionManager
public ClusterConnectionManager(ClusterServersConfig cfg, Config config, UUID id)
-
-
Method Detail
-
getEntrySet
public Collection<MasterSlaveEntry> getEntrySet()
- Specified by:
getEntrySet
in interfaceConnectionManager
- Overrides:
getEntrySet
in classMasterSlaveConnectionManager
-
getEntry
protected MasterSlaveEntry getEntry(RedisURI addr)
- Overrides:
getEntry
in classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(RedisClient redisClient)
- Specified by:
getEntry
in interfaceConnectionManager
- Overrides:
getEntry
in classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(InetSocketAddress address)
- Specified by:
getEntry
in interfaceConnectionManager
- Overrides:
getEntry
in classMasterSlaveConnectionManager
-
changeMaster
protected RFuture<RedisClient> changeMaster(int slot, RedisURI address)
- Overrides:
changeMaster
in classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(int slot)
- Specified by:
getEntry
in interfaceConnectionManager
- Overrides:
getEntry
in classMasterSlaveConnectionManager
-
createRedisConfig
protected RedisClientConfig createRedisConfig(NodeType type, RedisURI address, int timeout, int commandTimeout, String sslHostname)
- Overrides:
createRedisConfig
in classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot(byte[] key)
- Specified by:
calcSlot
in interfaceConnectionManager
- Overrides:
calcSlot
in classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot(String key)
- Specified by:
calcSlot
in interfaceConnectionManager
- Overrides:
calcSlot
in classMasterSlaveConnectionManager
-
applyNatMap
public RedisURI applyNatMap(RedisURI address)
- Specified by:
applyNatMap
in interfaceConnectionManager
- Overrides:
applyNatMap
in classMasterSlaveConnectionManager
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceConnectionManager
- Overrides:
shutdown
in classMasterSlaveConnectionManager
-
getLastClusterNode
public RedisURI getLastClusterNode()
- Specified by:
getLastClusterNode
in interfaceConnectionManager
- Overrides:
getLastClusterNode
in classMasterSlaveConnectionManager
-
isClusterMode
public boolean isClusterMode()
- Specified by:
isClusterMode
in interfaceConnectionManager
- Overrides:
isClusterMode
in classMasterSlaveConnectionManager
-
-