org.idevlab.rjc.sharding
Class HashNodeLocator<T>

java.lang.Object
  extended by org.idevlab.rjc.sharding.HashNodeLocator<T>
All Implemented Interfaces:
NodeLocator<T>

public class HashNodeLocator<T>
extends Object
implements NodeLocator<T>


Field Summary
static Pattern DEFAULT_KEY_TAG_PATTERN
           
 
Constructor Summary
HashNodeLocator()
           
HashNodeLocator(Collection<? extends Shard<T>> shards)
           
HashNodeLocator(Collection<? extends Shard<T>> shards, HashAlgorithm algo)
           
HashNodeLocator(Collection<? extends Shard<T>> shards, HashAlgorithm algo, Pattern tagPattern)
           
HashNodeLocator(Collection<? extends Shard<T>> shards, Pattern tagPattern)
           
 
Method Summary
 HashAlgorithm getAlgorithm()
           
 T getNode(String key)
           
 Collection<? extends T> getNodes()
           
 Pattern getTagPattern()
           
 void setAlgorithm(HashAlgorithm algorithm)
           
 void setShards(Collection<? extends Shard<T>> shards)
           
 void setTagPattern(Pattern tagPattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEY_TAG_PATTERN

public static final Pattern DEFAULT_KEY_TAG_PATTERN
Constructor Detail

HashNodeLocator

public HashNodeLocator()

HashNodeLocator

public HashNodeLocator(Collection<? extends Shard<T>> shards)

HashNodeLocator

public HashNodeLocator(Collection<? extends Shard<T>> shards,
                       HashAlgorithm algo)

HashNodeLocator

public HashNodeLocator(Collection<? extends Shard<T>> shards,
                       Pattern tagPattern)

HashNodeLocator

public HashNodeLocator(Collection<? extends Shard<T>> shards,
                       HashAlgorithm algo,
                       Pattern tagPattern)
Method Detail

setShards

public void setShards(Collection<? extends Shard<T>> shards)

getAlgorithm

public HashAlgorithm getAlgorithm()

setAlgorithm

public void setAlgorithm(HashAlgorithm algorithm)

getTagPattern

public Pattern getTagPattern()

setTagPattern

public void setTagPattern(Pattern tagPattern)

getNode

public T getNode(String key)
Specified by:
getNode in interface NodeLocator<T>

getNodes

public Collection<? extends T> getNodes()
Specified by:
getNodes in interface NodeLocator<T>


Copyright © 2011. All Rights Reserved.