Class JedisClusterConnection.JedisClusterTopologyProvider
java.lang.Object
org.springframework.data.redis.connection.jedis.JedisClusterConnection.JedisClusterTopologyProvider
- All Implemented Interfaces:
ClusterTopologyProvider
- Enclosing class:
- JedisClusterConnection
public static class JedisClusterConnection.JedisClusterTopologyProvider
extends Object
implements ClusterTopologyProvider
Jedis specific implementation of
ClusterTopologyProvider.- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionJedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster) JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster, Duration cacheTimeout) -
Method Summary
Modifier and TypeMethodDescriptionGet the current knownClusterTopology.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected booleanReturns whethergetTopology()should return the cachedJedisClusterConnection.JedisClusterTopology.
-
Constructor Details
-
JedisClusterTopologyProvider
public JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster) Create newJedisClusterConnection.JedisClusterTopologyProvider. Uses a default cache timeout of 100 milliseconds.- Parameters:
cluster- must not be null.
-
JedisClusterTopologyProvider
public JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster, Duration cacheTimeout) - Parameters:
cluster- must not be null.cacheTimeout- must not be null.- Since:
- 2.2
-
-
Method Details
-
getTopology
Description copied from interface:ClusterTopologyProviderGet the current knownClusterTopology.- Specified by:
getTopologyin interfaceClusterTopologyProvider- Returns:
- never null.
-
shouldUseCachedValue
Deprecated, for removal: This API element is subject to removal in a future version.since 3.3.4, useshouldUseCachedValue(JedisClusterTopology)instead.Returns whethergetTopology()should return the cachedClusterTopology. Uses a time-based caching.- Returns:
- true to use the cached
ClusterTopology; false to fetch a new cluster topology. - Since:
- 2.2
- See Also:
-
shouldUseCachedValue
protected boolean shouldUseCachedValue(@Nullable JedisClusterConnection.JedisClusterTopology topology) Returns whethergetTopology()should return the cachedJedisClusterConnection.JedisClusterTopology. Uses a time-based caching.- Returns:
- true to use the cached
ClusterTopology; false to fetch a new cluster topology. - Since:
- 3.3.4
- See Also:
-
shouldUseCachedValue(JedisClusterTopology)instead.