org.idevlab.rjc.sharding
Class HashNodeLocator<T>
java.lang.Object
org.idevlab.rjc.sharding.HashNodeLocator<T>
- All Implemented Interfaces:
- NodeLocator<T>
public class HashNodeLocator<T>
- extends Object
- implements NodeLocator<T>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_KEY_TAG_PATTERN
public static final Pattern DEFAULT_KEY_TAG_PATTERN
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)
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.