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 Object
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 Pattern DEFAULT_KEY_TAG_PATTERN
Sharded
public Sharded(List<S> shards)
Sharded
public Sharded(List<S> shards,
Hashing algo)
Sharded
public Sharded(List<S> shards,
Pattern tagPattern)
Sharded
public Sharded(List<S> shards,
Hashing algo,
Pattern tagPattern)
getShard
public R getShard(byte[] key)
getShard
public R getShard(String key)
getShardInfo
public S getShardInfo(byte[] key)
getShardInfo
public S getShardInfo(String key)
getKeyTag
public String getKeyTag(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 Collection<S> getAllShardInfo()
getAllShards
public Collection<R> getAllShards()
Copyright © 2012. All Rights Reserved.