Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions fastfilter/src/main/java/org/fastfilter/xor/XorBinaryFuse8.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ private void addAll(long[] keys) {
// we have a possible counter overflow
// this branch is never taken except if there is a problem in the hash code
// in which case construction fails
hashIndex++;
Arrays.fill(t2count, (byte) 0);
Arrays.fill(t2hash, 0);
Arrays.fill(reverseOrder, 0);

if (hashIndex > 100) {
// if construction doesn't succeed eventually,
// then there is likely a problem with the hash function
throw new IllegalArgumentException("Construction failed after " + hashIndex + " retries for size " + size);
}
// use a new random numbers
seed = Hash.randomSeed();
break;
}

Expand Down Expand Up @@ -199,11 +211,6 @@ private void addAll(long[] keys) {
Arrays.fill(t2hash, 0);
Arrays.fill(reverseOrder, 0);

// TODO
// if (hashIndex > 10) {
// System.out.println("WARNING: hashIndex " + hashIndex + "\n");
// System.out.println(size + " keys; arrayLength " + arrayLength + " reverseOrderPos " + reverseOrderPos + " segmentLength " + segmentLength + " segmentCount " + segmentCount);
// }
if (hashIndex > 100) {
// if construction doesn't succeed eventually,
// then there is likely a problem with the hash function
Expand Down