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
ConstructorDescriptionJedisClusterTopologyProvider
(redis.clients.jedis.JedisCluster cluster) JedisClusterTopologyProvider
(redis.clients.jedis.JedisCluster cluster, Duration cacheTimeout) -
Method Summary
Modifier and TypeMethodDescriptionGet the current knownClusterTopology
.protected boolean
Returns whethergetTopology()
should return the cachedClusterTopology
.
-
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:ClusterTopologyProvider
Get the current knownClusterTopology
.- Specified by:
getTopology
in interfaceClusterTopologyProvider
- Returns:
- never null.
-
shouldUseCachedValue
protected boolean shouldUseCachedValue()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:
-