Class ClusterTopologyRefreshOptions


  • public class ClusterTopologyRefreshOptions
    extends Object
    Options to control the Cluster topology refreshing of RedisClusterClient.
    Since:
    4.2
    Author:
    Mark Paluch
    • Field Detail

      • DEFAULT_ADAPTIVE_REFRESH_TIMEOUT

        public static final long DEFAULT_ADAPTIVE_REFRESH_TIMEOUT
        See Also:
        Constant Field Values
      • DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_UNIT

        public static final TimeUnit DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_UNIT
      • DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_DURATION

        public static final Duration DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_DURATION
      • DEFAULT_CLOSE_STALE_CONNECTIONS

        public static final boolean DEFAULT_CLOSE_STALE_CONNECTIONS
        See Also:
        Constant Field Values
      • DEFAULT_DYNAMIC_REFRESH_SOURCES

        public static final boolean DEFAULT_DYNAMIC_REFRESH_SOURCES
        See Also:
        Constant Field Values
      • DEFAULT_PERIODIC_REFRESH_ENABLED

        public static final boolean DEFAULT_PERIODIC_REFRESH_ENABLED
        See Also:
        Constant Field Values
      • DEFAULT_REFRESH_PERIOD

        public static final long DEFAULT_REFRESH_PERIOD
        See Also:
        Constant Field Values
      • DEFAULT_REFRESH_PERIOD_UNIT

        public static final TimeUnit DEFAULT_REFRESH_PERIOD_UNIT
      • DEFAULT_REFRESH_PERIOD_DURATION

        public static final Duration DEFAULT_REFRESH_PERIOD_DURATION
      • DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS

        public static final int DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS
        See Also:
        Constant Field Values
    • Method Detail

      • getAdaptiveRefreshTriggers

        public Set<ClusterTopologyRefreshOptions.RefreshTrigger> getAdaptiveRefreshTriggers()
        Returns the set of triggers. Adaptive refresh triggers initiate topology view updates based on events happened during Redis Cluster operations. Adaptive triggers lead to an immediate topology refresh. Adaptive triggered refreshes are rate-limited using a timeout since events can happen on a large scale. Adaptive refresh triggers are disabled by default.
        Returns:
        the set of triggers
      • getAdaptiveRefreshTimeout

        public Duration getAdaptiveRefreshTimeout()
        Timeout between adaptive cluster topology updates. Defaults to 30.
        Returns:
        the period between the regular cluster topology updates
      • isCloseStaleConnections

        public boolean isCloseStaleConnections()
        Flag, whether to close stale connections when refreshing the cluster topology. Defaults to true. Comes only into effect if isPeriodicRefreshEnabled() is true.
        Returns:
        true if stale connections are cleaned up after cluster topology updates
      • useDynamicRefreshSources

        public boolean useDynamicRefreshSources()
        Discover cluster nodes from topology and use the discovered nodes as source for the cluster topology. Using dynamic refresh will query all discovered nodes for the cluster topology and calculate the number of clients for each node. If set to false, only the initial seed nodes will be used as sources for topology discovery and the number of clients including response latency will be obtained only for the initial seed nodes. This can be useful when using Redis Cluster with many nodes. Defaults to true. See DEFAULT_DYNAMIC_REFRESH_SOURCES.
        Returns:
        true if dynamic refresh sources are enabled
      • isPeriodicRefreshEnabled

        public boolean isPeriodicRefreshEnabled()
        Flag, whether regular cluster topology updates are updated. The client starts updating the cluster topology in the intervals of getRefreshPeriod(). Defaults to false.
        Returns:
        true it the cluster topology view is updated periodically
      • getRefreshPeriod

        public Duration getRefreshPeriod()
        Period between the regular cluster topology updates. Defaults to 60.
        Returns:
        the period between the regular cluster topology updates