made getShardInfo(byte[]) public

This commit is contained in:
Dmytro
2011-03-21 14:32:50 +00:00
parent 121af74972
commit 0801b01ccb

View File

@@ -70,7 +70,7 @@ public class Sharded<R, S extends ShardInfo<R>> {
return resources.get(getShardInfo(key)); return resources.get(getShardInfo(key));
} }
private S getShardInfo(byte[] key) { public S getShardInfo(byte[] key) {
SortedMap<Long, S> tail = nodes.tailMap(algo.hash(key)); SortedMap<Long, S> tail = nodes.tailMap(algo.hash(key));
if (tail.size() == 0) { if (tail.size() == 0) {
return nodes.get(nodes.firstKey()); return nodes.get(nodes.firstKey());