Browse files

We use FNV hash functions to generate a large indexable sequence of n…

…on-colliding keys. Unforunately, for reasonably sized

workloads, this leads to key collisions, which throws off experiments.

The implementations of the FNV32 and FNV64 hash functions we use manipulate signed integers instead of unsigned integers, so it
is unclear if this is a limitation of the FNV algorithms or of our implementations.

As a workaround, this patch switches from FNV32 to FNV64, reducing the chances of such bad behavior (and eliminating it in our
experiments to date).
  • Loading branch information...
1 parent a1d5f70 commit 72832a88ffcdb0ecd8272f8ec5c795a7ed357aba Russell Sears committed Nov 19, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/com/yahoo/ycsb/
  2. +1 −1 src/com/yahoo/ycsb/workloads/
@@ -48,9 +48,9 @@ public static String ASCIIString(int length)
* Hash an integer value.
- public static int hash(int val)
+ public static long hash(long val)
- return FNVhash32(val);
+ return FNVhash64(val);
public static final int FNV_offset_basis_32=0x811c9dc5;
@@ -411,7 +411,7 @@ else if (scanlengthdistrib.compareTo("zipfian")==0)
- public String buildKeyName(int keynum) {
+ public String buildKeyName(long keynum) {
if (!orderedinserts)

0 comments on commit 72832a8

Please sign in to comment.