Skip to content
Snippets Groups Projects
Commit 72832a88 authored by Russell Sears's avatar Russell Sears
Browse files

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

We use FNV hash functions to generate a large indexable sequence of non-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).
parent a1d5f707
No related branches found
No related tags found
No related merge requests found
......@@ -48,9 +48,9 @@ public class Utils
/**
* 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 @@ public class CoreWorkload extends Workload
}
}
public String buildKeyName(int keynum) {
public String buildKeyName(long keynum) {
if (!orderedinserts)
{
keynum=Utils.hash(keynum);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment