public static class JedisClusterConnection.JedisClusterTopologyProvider extends Object implements ClusterTopologyProvider
ClusterTopologyProvider
.Constructor and Description |
---|
JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster)
|
JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster,
Duration cacheTimeout)
|
Modifier and Type | Method and Description |
---|---|
ClusterTopology |
getTopology()
Get the current known
ClusterTopology . |
protected boolean |
shouldUseCachedValue()
Returns whether
getTopology() should return the cached ClusterTopology . |
public JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster)
JedisClusterConnection.JedisClusterTopologyProvider
. Uses a default cache timeout of 100 milliseconds.cluster
- must not be null.public JedisClusterTopologyProvider(redis.clients.jedis.JedisCluster cluster, Duration cacheTimeout)
cluster
- must not be null.cacheTimeout
- must not be null.public ClusterTopology getTopology()
ClusterTopologyProvider
ClusterTopology
.getTopology
in interface ClusterTopologyProvider
protected boolean shouldUseCachedValue()
getTopology()
should return the cached ClusterTopology
. Uses a time-based
caching.ClusterTopology
; false to fetch a new cluster
topology.JedisClusterTopologyProvider(JedisCluster, Duration)
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.