redis.clients.util
Class Sharded<R,S extends ShardInfo<R>>

java.lang.Object
  extended by redis.clients.util.Sharded<R,S>
Direct Known Subclasses:
BinaryShardedJedis

public class Sharded<R,S extends ShardInfo<R>>
extends Object


Field Summary
static Pattern DEFAULT_KEY_TAG_PATTERN
           
static int DEFAULT_WEIGHT
           
 
Constructor Summary
Sharded(List<S> shards)
           
Sharded(List<S> shards, Hashing algo)
           
Sharded(List<S> shards, Hashing algo, Pattern tagPattern)
           
Sharded(List<S> shards, Pattern tagPattern)
           
 
Method Summary
 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(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

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)
Method Detail

getShard

public R getShard(byte[] key)

getShard

public R getShard(String 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 © 2010. All Rights Reserved.