Package org.redisson.config
Class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig<T>>
- java.lang.Object
-
- org.redisson.config.BaseConfig<T>
-
- org.redisson.config.BaseMasterSlaveServersConfig<T>
-
- Type Parameters:
T
- config type
- Direct Known Subclasses:
ClusterServersConfig
,MasterSlaveServersConfig
,ReplicatedServersConfig
,SentinelServersConfig
public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig<T>> extends BaseConfig<T>
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description BaseMasterSlaveServersConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkSkipSlavesInit()
long
getDnsMonitoringInterval()
int
getFailedSlaveCheckInterval()
int
getFailedSlaveReconnectionInterval()
LoadBalancer
getLoadBalancer()
int
getMasterConnectionMinimumIdleSize()
int
getMasterConnectionPoolSize()
ReadMode
getReadMode()
int
getSlaveConnectionMinimumIdleSize()
int
getSlaveConnectionPoolSize()
int
getSubscriptionConnectionMinimumIdleSize()
int
getSubscriptionConnectionPoolSize()
SubscriptionMode
getSubscriptionMode()
T
setDnsMonitoringInterval(long dnsMonitoringInterval)
Interval in milliseconds to check the endpoint's DNST
setFailedSlaveCheckInterval(int slaveFailsInterval)
Redis Slave node failing to execute commands is excluded from the internal list of available nodes when the time interval from the moment of first Redis command execution failure on this server reachesslaveFailsInterval
value.T
setFailedSlaveReconnectionInterval(int failedSlavesReconnectionTimeout)
Interval of Redis Slave reconnection attempt when it was excluded from internal list of available servers.T
setLoadBalancer(LoadBalancer loadBalancer)
Сonnection load balancer to multiple Redis slave servers.T
setMasterConnectionMinimumIdleSize(int masterConnectionMinimumIdleSize)
Redis 'master' node minimum idle connection amount for each slave nodeT
setMasterConnectionPoolSize(int masterConnectionPoolSize)
Redis 'master' server connection pool size.T
setReadMode(ReadMode readMode)
Set node type used for read operation.T
setSlaveConnectionMinimumIdleSize(int slaveConnectionMinimumIdleSize)
Minimum idle connection pool size for subscription (pub/sub) channelsT
setSlaveConnectionPoolSize(int slaveConnectionPoolSize)
Redis 'slave' servers connection pool size for each slave node.T
setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize)
Redis 'slave' node minimum idle subscription (pub/sub) connection amount for each slave node.T
setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize)
Maximum connection pool size for subscription (pub/sub) channelsT
setSubscriptionMode(SubscriptionMode subscriptionMode)
Set node type used for subscription operation.-
Methods inherited from class org.redisson.config.BaseConfig
getClientName, getConnectTimeout, getIdleConnectionTimeout, getNameMapper, getPassword, getPingConnectionInterval, getRetryAttempts, getRetryInterval, getSslKeystore, getSslKeystorePassword, getSslProtocols, getSslProvider, getSslTruststore, getSslTruststorePassword, getSubscriptionsPerConnection, getTimeout, getUsername, isKeepAlive, isSslEnableEndpointIdentification, isTcpNoDelay, setClientName, setConnectTimeout, setIdleConnectionTimeout, setKeepAlive, setNameMapper, setPassword, setPingConnectionInterval, setRetryAttempts, setRetryInterval, setSslEnableEndpointIdentification, setSslKeystore, setSslKeystorePassword, setSslProtocols, setSslProvider, setSslTruststore, setSslTruststorePassword, setSubscriptionsPerConnection, setTcpNoDelay, setTimeout, setUsername
-
-
-
-
Method Detail
-
setSlaveConnectionPoolSize
public T setSlaveConnectionPoolSize(int slaveConnectionPoolSize)
Redis 'slave' servers connection pool size for each slave node.Default is
64
- Parameters:
slaveConnectionPoolSize
- - size of pool- Returns:
- config
- See Also:
setSlaveConnectionMinimumIdleSize(int)
-
getSlaveConnectionPoolSize
public int getSlaveConnectionPoolSize()
-
setFailedSlaveReconnectionInterval
public T setFailedSlaveReconnectionInterval(int failedSlavesReconnectionTimeout)
Interval of Redis Slave reconnection attempt when it was excluded from internal list of available servers.On every such timeout event Redisson tries to connect to disconnected Redis server.
Default is 3000
- Parameters:
failedSlavesReconnectionTimeout
- - retry timeout in milliseconds- Returns:
- config
-
getFailedSlaveReconnectionInterval
public int getFailedSlaveReconnectionInterval()
-
setFailedSlaveCheckInterval
public T setFailedSlaveCheckInterval(int slaveFailsInterval)
Redis Slave node failing to execute commands is excluded from the internal list of available nodes when the time interval from the moment of first Redis command execution failure on this server reachesslaveFailsInterval
value.Default is
180000
- Parameters:
slaveFailsInterval
- - time interval in milliseconds- Returns:
- config
-
getFailedSlaveCheckInterval
public int getFailedSlaveCheckInterval()
-
setMasterConnectionPoolSize
public T setMasterConnectionPoolSize(int masterConnectionPoolSize)
Redis 'master' server connection pool size.Default is
64
- Parameters:
masterConnectionPoolSize
- - pool size- Returns:
- config
- See Also:
setMasterConnectionMinimumIdleSize(int)
-
getMasterConnectionPoolSize
public int getMasterConnectionPoolSize()
-
setLoadBalancer
public T setLoadBalancer(LoadBalancer loadBalancer)
Сonnection load balancer to multiple Redis slave servers. Uses Round-robin algorithm by default- Parameters:
loadBalancer
- object- Returns:
- config
- See Also:
RandomLoadBalancer
,RoundRobinLoadBalancer
,WeightedRoundRobinBalancer
-
getLoadBalancer
public LoadBalancer getLoadBalancer()
-
setSubscriptionConnectionPoolSize
public T setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize)
Maximum connection pool size for subscription (pub/sub) channelsDefault is
50
- Parameters:
subscriptionConnectionPoolSize
- - pool size- Returns:
- config
- See Also:
setSubscriptionConnectionMinimumIdleSize(int)
-
getSubscriptionConnectionPoolSize
public int getSubscriptionConnectionPoolSize()
-
setSlaveConnectionMinimumIdleSize
public T setSlaveConnectionMinimumIdleSize(int slaveConnectionMinimumIdleSize)
Minimum idle connection pool size for subscription (pub/sub) channelsDefault is
24
- Parameters:
slaveConnectionMinimumIdleSize
- - pool size- Returns:
- config
- See Also:
setSlaveConnectionPoolSize(int)
-
getSlaveConnectionMinimumIdleSize
public int getSlaveConnectionMinimumIdleSize()
-
setMasterConnectionMinimumIdleSize
public T setMasterConnectionMinimumIdleSize(int masterConnectionMinimumIdleSize)
Redis 'master' node minimum idle connection amount for each slave nodeDefault is
24
- Parameters:
masterConnectionMinimumIdleSize
- - pool size- Returns:
- config
- See Also:
setMasterConnectionPoolSize(int)
-
getMasterConnectionMinimumIdleSize
public int getMasterConnectionMinimumIdleSize()
-
setSubscriptionConnectionMinimumIdleSize
public T setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize)
Redis 'slave' node minimum idle subscription (pub/sub) connection amount for each slave node.Default is
1
- Parameters:
subscriptionConnectionMinimumIdleSize
- - pool size- Returns:
- config
- See Also:
setSubscriptionConnectionPoolSize(int)
-
getSubscriptionConnectionMinimumIdleSize
public int getSubscriptionConnectionMinimumIdleSize()
-
setReadMode
public T setReadMode(ReadMode readMode)
Set node type used for read operation.Default is
SLAVE
- Parameters:
readMode
- param- Returns:
- config
-
getReadMode
public ReadMode getReadMode()
-
checkSkipSlavesInit
public boolean checkSkipSlavesInit()
-
setSubscriptionMode
public T setSubscriptionMode(SubscriptionMode subscriptionMode)
Set node type used for subscription operation.Default is
MASTER
- Parameters:
subscriptionMode
- param- Returns:
- config
-
getSubscriptionMode
public SubscriptionMode getSubscriptionMode()
-
setDnsMonitoringInterval
public T setDnsMonitoringInterval(long dnsMonitoringInterval)
Interval in milliseconds to check the endpoint's DNSApplications must ensure the JVM DNS cache TTL is low enough to support this.
Set
-1
to disable.Default is
5000
.- Parameters:
dnsMonitoringInterval
- time- Returns:
- config
-
getDnsMonitoringInterval
public long getDnsMonitoringInterval()
-
-