redis.clients.util
Class Sharded<R,S extends ShardInfo<R>>
java.lang.Object
redis.clients.util.Sharded<R,S>
- Direct Known Subclasses:
- BinaryShardedJedis
public class Sharded<R,S extends ShardInfo<R>>
- extends java.lang.Object
Constructor Summary |
Sharded(java.util.List<S> shards)
|
Sharded(java.util.List<S> shards,
Hashing algo)
|
Sharded(java.util.List<S> shards,
Hashing algo,
java.util.regex.Pattern tagPattern)
|
Sharded(java.util.List<S> shards,
java.util.regex.Pattern tagPattern)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHT
- See Also:
- Constant Field Values
DEFAULT_KEY_TAG_PATTERN
public static final java.util.regex.Pattern DEFAULT_KEY_TAG_PATTERN
Sharded
public Sharded(java.util.List<S> shards)
Sharded
public Sharded(java.util.List<S> shards,
Hashing algo)
Sharded
public Sharded(java.util.List<S> shards,
java.util.regex.Pattern tagPattern)
Sharded
public Sharded(java.util.List<S> shards,
Hashing algo,
java.util.regex.Pattern tagPattern)
getShard
public R getShard(byte[] key)
getShard
public R getShard(java.lang.String key)
getShardInfo
public S getShardInfo(byte[] key)
getShardInfo
public S getShardInfo(java.lang.String key)
getKeyTag
public java.lang.String getKeyTag(java.lang.String key)
- A key tag is a special pattern inside a key that, if preset, is the only
part of the key hashed in order to select the server for this key.
- Parameters:
key
-
- Returns:
- The tag if it exists, or the original key
- See Also:
'm_using_some_form_of_key_hashing_for_partitioning,_but_wh
getAllShardInfo
public java.util.Collection<S> getAllShardInfo()
getAllShards
public java.util.Collection<R> getAllShards()