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
-
Field Summary
Fields inherited from class org.redisson.config.BaseConfig
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
int
Deprecated.int
int
int
int
int
int
int
boolean
setDnsMonitoringInterval
(long dnsMonitoringInterval) Interval in milliseconds to check the endpoint's DNSsetFailedSlaveCheckInterval
(int slaveFailsInterval) Deprecated.setFailedSlaveNodeDetector
(FailedNodeDetector failedNodeDetector) Defines failed Redis Slave node detector object which implements failed node detection logic.setFailedSlaveReconnectionInterval
(int failedSlavesReconnectionTimeout) When the retry intervalfailedSlavesReconnectionTimeout
reached Redisson tries to connect to failed Redis node reported by
failedSlaveNodeDetector
.setLoadBalancer
(LoadBalancer loadBalancer) Сonnection load balancer to multiple Redis slave servers.setMasterConnectionMinimumIdleSize
(int masterConnectionMinimumIdleSize) Redis 'master' node minimum idle connection amount for each slave nodesetMasterConnectionPoolSize
(int masterConnectionPoolSize) Redis 'master' server connection pool size.setReadMode
(ReadMode readMode) Set node type used for read operation.setSlaveConnectionMinimumIdleSize
(int slaveConnectionMinimumIdleSize) Minimum idle connection pool size for subscription (pub/sub) channelssetSlaveConnectionPoolSize
(int slaveConnectionPoolSize) Redis 'slave' servers connection pool size for each slave node.setSubscriptionConnectionMinimumIdleSize
(int subscriptionConnectionMinimumIdleSize) Redis 'slave' node minimum idle subscription (pub/sub) connection amount for each slave node.setSubscriptionConnectionPoolSize
(int subscriptionConnectionPoolSize) Maximum connection pool size for subscription (pub/sub) channelssetSubscriptionMode
(SubscriptionMode subscriptionMode) Set node type used for subscription operation.Methods inherited from class org.redisson.config.BaseConfig
getClientName, getCommandMapper, getConnectTimeout, getCredentialsResolver, getIdleConnectionTimeout, getNameMapper, getPassword, getPingConnectionInterval, getRetryAttempts, getRetryInterval, getSslCiphers, getSslKeyManagerFactory, getSslKeystore, getSslKeystorePassword, getSslKeystoreType, getSslProtocols, getSslProvider, getSslTrustManagerFactory, getSslTruststore, getSslTruststorePassword, getSubscriptionsPerConnection, getSubscriptionTimeout, getTcpKeepAliveCount, getTcpKeepAliveIdle, getTcpKeepAliveInterval, getTcpUserTimeout, getTimeout, getUsername, isKeepAlive, isSslEnableEndpointIdentification, isTcpNoDelay, setClientName, setCommandMapper, setConnectTimeout, setCredentialsResolver, setIdleConnectionTimeout, setKeepAlive, setNameMapper, setPassword, setPingConnectionInterval, setRetryAttempts, setRetryInterval, setSslCiphers, setSslEnableEndpointIdentification, setSslKeyManagerFactory, setSslKeystore, setSslKeystorePassword, setSslKeystoreType, setSslProtocols, setSslProvider, setSslTrustManagerFactory, setSslTruststore, setSslTruststorePassword, setSubscriptionsPerConnection, setSubscriptionTimeout, setTcpKeepAliveCount, setTcpKeepAliveIdle, setTcpKeepAliveInterval, setTcpNoDelay, setTcpUserTimeout, setTimeout, setUsername
-
Constructor Details
-
BaseMasterSlaveServersConfig
public BaseMasterSlaveServersConfig()
-
-
Method Details
-
setSlaveConnectionPoolSize
Redis 'slave' servers connection pool size for each slave node.Default is
64
- Parameters:
slaveConnectionPoolSize
- - size of pool- Returns:
- config
- See Also:
-
getSlaveConnectionPoolSize
public int getSlaveConnectionPoolSize() -
setFailedSlaveReconnectionInterval
When the retry intervalfailedSlavesReconnectionTimeout
reached Redisson tries to connect to failed Redis node reported by
failedSlaveNodeDetector
.On every such timeout event Redisson tries to connect to failed Redis server.
Default is 3000
- Parameters:
failedSlavesReconnectionTimeout
- - retry timeout in milliseconds- Returns:
- config
-
getFailedSlaveReconnectionInterval
public int getFailedSlaveReconnectionInterval() -
setFailedSlaveCheckInterval
Deprecated.UsesetFailedSlaveNodeDetector(FailedNodeDetector)
instead.- Parameters:
slaveFailsInterval
- - time interval in milliseconds- Returns:
- config
-
getFailedSlaveCheckInterval
Deprecated. -
setMasterConnectionPoolSize
Redis 'master' server connection pool size.Default is
64
- Parameters:
masterConnectionPoolSize
- - pool size- Returns:
- config
- See Also:
-
getMasterConnectionPoolSize
public int getMasterConnectionPoolSize() -
setLoadBalancer
Сonnection load balancer to multiple Redis slave servers. Uses Round-robin algorithm by default- Parameters:
loadBalancer
- object- Returns:
- config
- See Also:
-
getLoadBalancer
-
setSubscriptionConnectionPoolSize
Maximum connection pool size for subscription (pub/sub) channelsDefault is
50
- Parameters:
subscriptionConnectionPoolSize
- - pool size- Returns:
- config
- See Also:
-
getSubscriptionConnectionPoolSize
public int getSubscriptionConnectionPoolSize() -
setSlaveConnectionMinimumIdleSize
Minimum idle connection pool size for subscription (pub/sub) channelsDefault is
24
- Parameters:
slaveConnectionMinimumIdleSize
- - pool size- Returns:
- config
- See Also:
-
getSlaveConnectionMinimumIdleSize
public int getSlaveConnectionMinimumIdleSize() -
setMasterConnectionMinimumIdleSize
Redis 'master' node minimum idle connection amount for each slave nodeDefault is
24
- Parameters:
masterConnectionMinimumIdleSize
- - pool size- Returns:
- config
- See Also:
-
getMasterConnectionMinimumIdleSize
public int getMasterConnectionMinimumIdleSize() -
setSubscriptionConnectionMinimumIdleSize
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:
-
getSubscriptionConnectionMinimumIdleSize
public int getSubscriptionConnectionMinimumIdleSize() -
setReadMode
Set node type used for read operation.Default is
SLAVE
- Parameters:
readMode
- param- Returns:
- config
-
getReadMode
-
isSlaveNotUsed
public boolean isSlaveNotUsed() -
setSubscriptionMode
Set node type used for subscription operation.Default is
MASTER
- Parameters:
subscriptionMode
- param- Returns:
- config
-
getSubscriptionMode
-
setDnsMonitoringInterval
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() -
setFailedSlaveNodeDetector
Defines failed Redis Slave node detector object which implements failed node detection logic.Default is
org.redisson.client.FailedConnectionDetector
- Parameters:
failedNodeDetector
- Redis Slave node detector object- Returns:
- config
- See Also:
-
getFailedSlaveNodeDetector
-