public class ClusterTopologyRefreshOptions extends Object
RedisClusterClient
.Modifier and Type | Class and Description |
---|---|
static class |
ClusterTopologyRefreshOptions.Builder
Builder for
ClusterTopologyRefreshOptions . |
static class |
ClusterTopologyRefreshOptions.RefreshTrigger
Available refresh triggers to signal early topology refreshing.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ADAPTIVE_REFRESH_TIMEOUT |
static Duration |
DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_DURATION |
static TimeUnit |
DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_UNIT |
static Set<ClusterTopologyRefreshOptions.RefreshTrigger> |
DEFAULT_ADAPTIVE_REFRESH_TRIGGERS |
static boolean |
DEFAULT_CLOSE_STALE_CONNECTIONS |
static boolean |
DEFAULT_DYNAMIC_REFRESH_SOURCES |
static boolean |
DEFAULT_PERIODIC_REFRESH_ENABLED |
static long |
DEFAULT_REFRESH_PERIOD |
static Duration |
DEFAULT_REFRESH_PERIOD_DURATION |
static TimeUnit |
DEFAULT_REFRESH_PERIOD_UNIT |
static int |
DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS |
Modifier | Constructor and Description |
---|---|
protected |
ClusterTopologyRefreshOptions(ClusterTopologyRefreshOptions.Builder builder) |
protected |
ClusterTopologyRefreshOptions(ClusterTopologyRefreshOptions original) |
Modifier and Type | Method and Description |
---|---|
static ClusterTopologyRefreshOptions.Builder |
builder()
Returns a new
ClusterTopologyRefreshOptions.Builder to construct ClusterTopologyRefreshOptions . |
static ClusterTopologyRefreshOptions |
copyOf(ClusterTopologyRefreshOptions options)
Create a copy of options.
|
static ClusterTopologyRefreshOptions |
create()
Create a new
ClusterTopologyRefreshOptions using default settings. |
static ClusterTopologyRefreshOptions |
enabled()
Create a new
ClusterTopologyRefreshOptions using default settings with enabled periodic and adaptive refresh. |
Duration |
getAdaptiveRefreshTimeout()
Timeout between adaptive cluster topology updates.
|
Set<ClusterTopologyRefreshOptions.RefreshTrigger> |
getAdaptiveRefreshTriggers()
Returns the set of
triggers . |
Duration |
getRefreshPeriod()
Period between the regular cluster topology updates.
|
int |
getRefreshTriggersReconnectAttempts()
|
boolean |
isCloseStaleConnections()
Flag, whether to close stale connections when refreshing the cluster topology.
|
boolean |
isPeriodicRefreshEnabled()
Flag, whether regular cluster topology updates are updated.
|
boolean |
useDynamicRefreshSources()
Discover cluster nodes from topology and use the discovered nodes as source for the cluster topology.
|
public static final boolean DEFAULT_PERIODIC_REFRESH_ENABLED
public static final long DEFAULT_REFRESH_PERIOD
public static final TimeUnit DEFAULT_REFRESH_PERIOD_UNIT
public static final Duration DEFAULT_REFRESH_PERIOD_DURATION
public static final boolean DEFAULT_DYNAMIC_REFRESH_SOURCES
public static final Set<ClusterTopologyRefreshOptions.RefreshTrigger> DEFAULT_ADAPTIVE_REFRESH_TRIGGERS
public static final long DEFAULT_ADAPTIVE_REFRESH_TIMEOUT
public static final TimeUnit DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_UNIT
public static final Duration DEFAULT_ADAPTIVE_REFRESH_TIMEOUT_DURATION
public static final int DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS
public static final boolean DEFAULT_CLOSE_STALE_CONNECTIONS
protected ClusterTopologyRefreshOptions(ClusterTopologyRefreshOptions.Builder builder)
protected ClusterTopologyRefreshOptions(ClusterTopologyRefreshOptions original)
public static ClusterTopologyRefreshOptions copyOf(ClusterTopologyRefreshOptions options)
options
- the originalClusterTopologyRefreshOptions
containing the values of optionspublic static ClusterTopologyRefreshOptions.Builder builder()
ClusterTopologyRefreshOptions.Builder
to construct ClusterTopologyRefreshOptions
.ClusterTopologyRefreshOptions.Builder
to construct ClusterTopologyRefreshOptions
.public static ClusterTopologyRefreshOptions create()
ClusterTopologyRefreshOptions
using default settings.public static ClusterTopologyRefreshOptions enabled()
ClusterTopologyRefreshOptions
using default settings with enabled periodic and adaptive refresh.public boolean isPeriodicRefreshEnabled()
getRefreshPeriod()
. Defaults to false.public Duration getRefreshPeriod()
public boolean isCloseStaleConnections()
isPeriodicRefreshEnabled()
is true.public boolean useDynamicRefreshSources()
true
if dynamic refresh sources are enabledpublic Set<ClusterTopologyRefreshOptions.RefreshTrigger> getAdaptiveRefreshTriggers()
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.triggers
public Duration getAdaptiveRefreshTimeout()
public int getRefreshTriggersReconnectAttempts()
ClusterTopologyRefreshOptions.RefreshTrigger.PERSISTENT_RECONNECTS
. Topology updates based on persistent reconnects lead only to
a refresh if the reconnect process tries at least refreshTriggersReconnectAttempts
. See
DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS
.Copyright © 2019 lettuce.io. All rights reserved.