Binary key & values seems to be implemented now

This commit is contained in:
Yaourt
2010-11-04 15:59:50 +01:00
parent 84bb16dd5e
commit e2d8148802
8 changed files with 417 additions and 35 deletions

View File

@@ -69,10 +69,19 @@ public class Sharded<R, S extends ShardInfo<R>> {
}
}
public R getShard(String key) {
return nodes.floorEntry(algo.hash(getKeyTag(key))).getValue()
.getResource();
}
public R getShard(byte[] key) {
return nodes
.floorEntry(algo.hash(key))
.getValue()
.getResource();
}
public R getShard(String key) {
return nodes
.floorEntry(algo.hash(getKeyTag(key)))
.getValue()
.getResource();
}
public S getShardInfo(String key) {
return nodes.floorEntry(algo.hash(getKeyTag(key))).getValue();