Package org.redisson.connection
Class MasterSlaveEntry
- java.lang.Object
-
- org.redisson.connection.MasterSlaveEntry
-
- Direct Known Subclasses:
SingleEntry
public class MasterSlaveEntry extends Object
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description MasterSlaveEntry(ConnectionManager connectionManager, MasterSlaveServersConfig config, String sslHostname)
-
Method Summary
-
-
-
Constructor Detail
-
MasterSlaveEntry
public MasterSlaveEntry(ConnectionManager connectionManager, MasterSlaveServersConfig config, String sslHostname)
-
-
Method Detail
-
getConfig
public MasterSlaveServersConfig getConfig()
-
initSlaveBalancer
public List<RFuture<Void>> initSlaveBalancer(Collection<RedisURI> disconnectedNodes, RedisClient master)
-
setupMasterEntry
public RFuture<RedisClient> setupMasterEntry(InetSocketAddress address, RedisURI uri)
-
setupMasterEntry
public RFuture<RedisClient> setupMasterEntry(RedisURI address)
-
slaveDown
public boolean slaveDown(ClientConnectionsEntry entry, ClientConnectionsEntry.FreezeReason freezeReason)
-
slaveDown
public boolean slaveDown(InetSocketAddress address, ClientConnectionsEntry.FreezeReason freezeReason)
-
slaveDown
public boolean slaveDown(RedisURI address, ClientConnectionsEntry.FreezeReason freezeReason)
-
masterDown
public void masterDown()
-
nodeDown
public boolean nodeDown(ClientConnectionsEntry entry)
-
hasSlave
public boolean hasSlave(RedisClient redisClient)
-
hasSlave
public boolean hasSlave(InetSocketAddress addr)
-
hasSlave
public boolean hasSlave(RedisURI addr)
-
getAvailableSlaves
public int getAvailableSlaves()
-
getAvailableClients
public int getAvailableClients()
-
addSlave
public RFuture<Void> addSlave(InetSocketAddress address, RedisURI uri)
-
getAllEntries
public Collection<ClientConnectionsEntry> getAllEntries()
-
getEntry
public ClientConnectionsEntry getEntry(RedisClient redisClient)
-
getClient
public RedisClient getClient()
-
slaveUp
public boolean slaveUp(ClientConnectionsEntry entry, ClientConnectionsEntry.FreezeReason freezeReason)
-
isSlaveUnfreezed
public boolean isSlaveUnfreezed(RedisURI address)
-
slaveUp
public boolean slaveUp(RedisURI address, ClientConnectionsEntry.FreezeReason freezeReason)
-
slaveUp
public boolean slaveUp(InetSocketAddress address, ClientConnectionsEntry.FreezeReason freezeReason)
-
changeMaster
public RFuture<RedisClient> changeMaster(RedisURI address)
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
public RFuture<RedisClient> changeMaster(InetSocketAddress address, RedisURI uri)
-
connectionWriteOp
public RFuture<RedisConnection> connectionWriteOp(RedisCommand<?> command)
-
redirectedConnectionWriteOp
public RFuture<RedisConnection> redirectedConnectionWriteOp(RedisCommand<?> command, RedisURI addr)
-
connectionReadOp
public RFuture<RedisConnection> connectionReadOp(RedisCommand<?> command)
-
connectionReadOp
public RFuture<RedisConnection> connectionReadOp(RedisCommand<?> command, RedisURI addr)
-
connectionReadOp
public RFuture<RedisConnection> connectionReadOp(RedisCommand<?> command, RedisClient client)
-
nextPubSubConnection
public RFuture<RedisPubSubConnection> nextPubSubConnection()
-
returnPubSubConnection
public void returnPubSubConnection(RedisPubSubConnection connection)
-
releaseWrite
public void releaseWrite(RedisConnection connection)
-
releaseRead
public void releaseRead(RedisConnection connection)
-
incReference
public void incReference()
-
decReference
public int decReference()
-
getReferences
public int getReferences()
-
-