Package org.redisson.cluster
Class ClusterConnectionManager
-
- 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, id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RedisURI
applyNatMap(RedisURI address)
int
calcSlot(byte[] key)
int
key)
protected RFuture<RedisClient>
changeMaster(int slot, RedisURI address)
protected RedisClientConfig
createRedisConfig(NodeType type, RedisURI address, int timeout, int commandTimeout, sslHostname)
MasterSlaveEntry
getEntry(int slot)
MasterSlaveEntry
address)
MasterSlaveEntry
getEntry(RedisClient redisClient)
protected MasterSlaveEntry
getEntry(RedisURI addr)
<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, id)
-
-
Method Detail
-
getEntrySet
public <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 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, sslHostname)
- Overrides:
createRedisConfig
in classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot(byte[] key)
- Specified by:
calcSlot
in interfaceConnectionManager
- Overrides:
calcSlot
in classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot( 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
-
-