Package org.redisson.connection
Class MasterSlaveEntry
java.lang.Object
org.redisson.connection.MasterSlaveEntry
- Direct Known Subclasses:
SingleEntry
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorDescriptionMasterSlaveEntry
(ConnectionManager connectionManager, MasterSlaveServersConfig config) -
Method Summary
Modifier and TypeMethodDescriptionaddSlave
(InetSocketAddress address, RedisURI uri) addSlave
(InetSocketAddress address, RedisURI uri, String sslHostname) addSlave
(RedisClient client) changeMaster
(InetSocketAddress address, RedisURI uri) changeMaster
(RedisURI address) Freeze slave withredis(s)://host:port
from slaves list.connectionReadOp
(RedisCommand<?> command, boolean trackChanges) connectionReadOp
(RedisCommand<?> command, RedisClient client, boolean trackChanges) connectionReadOp
(RedisCommand<?> command, RedisURI addr) connectionWriteOp
(RedisCommand<?> command) int
boolean
excludeMasterFromSlaves
(InetSocketAddress address) boolean
excludeMasterFromSlaves
(RedisURI address) int
getEntry()
getEntry
(InetSocketAddress address) getEntry
(RedisClient redisClient) int
boolean
hasSlave
(InetSocketAddress addr) boolean
hasSlave
(RedisClient redisClient) boolean
void
initSlaveBalancer
(Function<RedisURI, String> hostnameMapper) boolean
isInit()
void
redirectedConnectionWriteOp
(RedisCommand<?> command, RedisURI addr) void
releaseRead
(RedisConnection connection) void
releaseWrite
(RedisConnection connection) void
returnPubSubConnection
(RedisPubSubConnection connection) void
setAvailableSlaves
(int slaves) setupMasterEntry
(InetSocketAddress address, RedisURI uri) setupMasterEntry
(RedisURI address) setupMasterEntry
(RedisURI address, String sslHostname) void
shutdownAndReconnectAsync
(RedisClient client, Throwable cause) boolean
slaveDown
(InetSocketAddress address) boolean
slaveUpAsync
(InetSocketAddress address) slaveUpAsync
(RedisURI address) slaveUpNoMasterExclusionAsync
(RedisURI address) toString()
trackedConnectionWriteOp
(RedisCommand<?> command)
-
Constructor Details
-
MasterSlaveEntry
-
-
Method Details
-
getConfig
-
initSlaveBalancer
-
setupMasterEntry
-
setupMasterEntry
-
setupMasterEntry
-
slaveDown
-
slaveDown
-
shutdownAndReconnectAsync
-
masterDown
public void masterDown() -
hasSlave
-
hasSlave
-
hasSlave
-
addSlave
-
addSlave
-
addSlave
-
addSlave
public CompletableFuture<Void> addSlave(InetSocketAddress address, RedisURI uri, String sslHostname) -
addSlave
-
getAllEntries
-
getEntry
-
getEntry
-
getEntry
-
isInit
public boolean isInit() -
getClient
-
slaveUpAsync
-
excludeMasterFromSlaves
-
excludeMasterFromSlaves
-
slaveUpNoMasterExclusionAsync
-
slaveUpNoMasterExclusionAsync
-
slaveUpAsync
-
changeMaster
Freeze slave withredis(s)://host:port
from slaves list. Re-attach pub/sub listeners from it to other slave. Shutdown old master client.- Parameters:
address
- of Redis- Returns:
- client
-
changeMaster
-
shutdownAsync
-
connectionWriteOp
-
trackedConnectionWriteOp
-
redirectedConnectionWriteOp
public CompletableFuture<RedisConnection> redirectedConnectionWriteOp(RedisCommand<?> command, RedisURI addr) -
connectionReadOp
public CompletableFuture<RedisConnection> connectionReadOp(RedisCommand<?> command, boolean trackChanges) -
connectionReadOp
-
connectionReadOp
public CompletableFuture<RedisConnection> connectionReadOp(RedisCommand<?> command, RedisClient client, boolean trackChanges) -
nextPubSubConnection
-
returnPubSubConnection
-
releaseWrite
-
releaseRead
-
incReference
public void incReference() -
decReference
public int decReference() -
getReferences
public int getReferences() -
toString
-
getEntry
-
getAvailableSlaves
public int getAvailableSlaves() -
setAvailableSlaves
public void setAvailableSlaves(int slaves)
-