Replace CityHash 1.1 with xxHash as the default hash function

This commit is contained in:
leventov
2015-11-28 23:31:25 +03:00
parent bfa9988551
commit 2d7e25985a
5 changed files with 5 additions and 5 deletions
@@ -56,7 +56,7 @@ public class KeySegmentDistributionTest {
for (int i = 0; i < size; i++) {
random.nextBytes(keyBytes);
String key = new String(keyBytes, StandardCharsets.US_ASCII);
long hash = LongHashFunction.city_1_1().hashBytes(StandardCharsets.UTF_8.encode(key));
long hash = LongHashFunction.xx_r39().hashBytes(StandardCharsets.UTF_8.encode(key));
int segmentIndex = (((int) hash) & Integer.MAX_VALUE) % segments;
// Put the segment index as a value to the map
map.put(key, segmentIndex);