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 RedisURIapplyNatMap(RedisURI address)intcalcSlot(byte[] key)intcalcSlot(String key)protected RFuture<RedisClient>changeMaster(int slot, RedisURI address)protected RedisClientConfigcreateRedisConfig(NodeType type, RedisURI address, int timeout, int commandTimeout, String sslHostname)MasterSlaveEntrygetEntry(int slot)MasterSlaveEntrygetEntry(InetSocketAddress address)MasterSlaveEntrygetEntry(RedisClient redisClient)protected MasterSlaveEntrygetEntry(RedisURI addr)Collection<MasterSlaveEntry>getEntrySet()RedisURIgetLastClusterNode()booleanisClusterMode()voidshutdown()-
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:
getEntrySetin interfaceConnectionManager- Overrides:
getEntrySetin classMasterSlaveConnectionManager
-
getEntry
protected MasterSlaveEntry getEntry(RedisURI addr)
- Overrides:
getEntryin classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(RedisClient redisClient)
- Specified by:
getEntryin interfaceConnectionManager- Overrides:
getEntryin classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(InetSocketAddress address)
- Specified by:
getEntryin interfaceConnectionManager- Overrides:
getEntryin classMasterSlaveConnectionManager
-
changeMaster
protected RFuture<RedisClient> changeMaster(int slot, RedisURI address)
- Overrides:
changeMasterin classMasterSlaveConnectionManager
-
getEntry
public MasterSlaveEntry getEntry(int slot)
- Specified by:
getEntryin interfaceConnectionManager- Overrides:
getEntryin classMasterSlaveConnectionManager
-
createRedisConfig
protected RedisClientConfig createRedisConfig(NodeType type, RedisURI address, int timeout, int commandTimeout, String sslHostname)
- Overrides:
createRedisConfigin classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot(byte[] key)
- Specified by:
calcSlotin interfaceConnectionManager- Overrides:
calcSlotin classMasterSlaveConnectionManager
-
calcSlot
public int calcSlot(String key)
- Specified by:
calcSlotin interfaceConnectionManager- Overrides:
calcSlotin classMasterSlaveConnectionManager
-
applyNatMap
public RedisURI applyNatMap(RedisURI address)
- Specified by:
applyNatMapin interfaceConnectionManager- Overrides:
applyNatMapin classMasterSlaveConnectionManager
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceConnectionManager- Overrides:
shutdownin classMasterSlaveConnectionManager
-
getLastClusterNode
public RedisURI getLastClusterNode()
- Specified by:
getLastClusterNodein interfaceConnectionManager- Overrides:
getLastClusterNodein classMasterSlaveConnectionManager
-
isClusterMode
public boolean isClusterMode()
- Specified by:
isClusterModein interfaceConnectionManager- Overrides:
isClusterModein classMasterSlaveConnectionManager
-
-