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 Details

    • BaseMasterSlaveServersConfig

      public BaseMasterSlaveServersConfig()
  • Method Details

    • 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:
    • getSlaveConnectionPoolSize

      public int getSlaveConnectionPoolSize()
    • setFailedSlaveReconnectionInterval

      public T setFailedSlaveReconnectionInterval(int failedSlavesReconnectionTimeout)
      When the retry interval failedSlavesReconnectionTimeout 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 public T setFailedSlaveCheckInterval(int slaveFailsInterval)
      Deprecated.
      Parameters:
      slaveFailsInterval - - time interval in milliseconds
      Returns:
      config
    • getFailedSlaveCheckInterval

      @Deprecated public int getFailedSlaveCheckInterval()
      Deprecated.
    • setMasterConnectionPoolSize

      public T setMasterConnectionPoolSize(int masterConnectionPoolSize)
      Redis 'master' server connection pool size.

      Default is 64

      Parameters:
      masterConnectionPoolSize - - pool size
      Returns:
      config
      See Also:
    • 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:
    • getLoadBalancer

      public LoadBalancer getLoadBalancer()
    • setSubscriptionConnectionPoolSize

      public T setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize)
      Maximum connection pool size for subscription (pub/sub) channels

      Default is 50

      Parameters:
      subscriptionConnectionPoolSize - - pool size
      Returns:
      config
      See Also:
    • getSubscriptionConnectionPoolSize

      public int getSubscriptionConnectionPoolSize()
    • setSlaveConnectionMinimumIdleSize

      public T setSlaveConnectionMinimumIdleSize(int slaveConnectionMinimumIdleSize)
      Minimum idle connection pool size for subscription (pub/sub) channels

      Default is 24

      Parameters:
      slaveConnectionMinimumIdleSize - - pool size
      Returns:
      config
      See Also:
    • getSlaveConnectionMinimumIdleSize

      public int getSlaveConnectionMinimumIdleSize()
    • setMasterConnectionMinimumIdleSize

      public T setMasterConnectionMinimumIdleSize(int masterConnectionMinimumIdleSize)
      Redis 'master' node minimum idle connection amount for each slave node

      Default is 24

      Parameters:
      masterConnectionMinimumIdleSize - - pool size
      Returns:
      config
      See Also:
    • 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:
    • 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()
    • isSlaveNotUsed

      public boolean isSlaveNotUsed()
    • 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 DNS

      Applications 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

      public T setFailedSlaveNodeDetector(FailedNodeDetector failedNodeDetector)
      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

      public FailedNodeDetector getFailedSlaveNodeDetector()