Package redis.clients.jedis.util
Class Sharded<R,S extends ShardInfo<R>>
- java.lang.Object
-
- redis.clients.jedis.util.Sharded<R,S>
-
- Direct Known Subclasses:
BinaryShardedJedis
public class Sharded<R,S extends ShardInfo<R>> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
DEFAULT_KEY_TAG_PATTERN
static int
DEFAULT_WEIGHT
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<S>
getAllShardInfo()
Collection<R>
getAllShards()
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.R
getShard(byte[] key)
R
getShard(String key)
S
getShardInfo(byte[] key)
S
getShardInfo(String key)
-
-
-
Field Detail
-
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
-
-
Method Detail
-
getShard
public R getShard(byte[] key)
-
getShardInfo
public S getShardInfo(byte[] 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:
- partitioning
-
getAllShardInfo
public Collection<S> getAllShardInfo()
-
getAllShards
public Collection<R> getAllShards()
-
-