Skip to content

Commit

Permalink
Fix tests after feature flag
Browse files Browse the repository at this point in the history
Signed-off-by: mgodwan <mgodwan@amazon.com>
  • Loading branch information
mgodwan committed Feb 1, 2024
1 parent 278dfea commit b898785
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class BloomFilter extends AbstractFuzzySet {
int setSize = (int) Math.ceil((maxDocs * Math.log(maxFpp)) / Math.log(1 / Math.pow(2, Math.log(2))));
setSize = getNearestSetSize(setSize < Integer.MAX_VALUE / 2 ? 2 * setSize : Integer.MAX_VALUE);
int optimalK = (int) Math.round(((double) setSize / maxDocs) * Math.log(2));
this.bitset = new LongArrayBackedBitSet(setSize + 1);
this.bitset = new LongArrayBackedBitSet(setSize);
this.setSize = setSize;
this.hashCount = optimalK;
addAll(fieldIteratorProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LongArrayBackedBitSet implements Accountable, Closeable {
*/
LongArrayBackedBitSet(long capacity) {
// Since the bitset is backed by a long array, we only need 1 element for every 64 bits in the underlying array.
underlyingArrayLength = ((capacity - 1L) >> 6) + 1;
underlyingArrayLength = (capacity >> 6) + 1L;
this.longArray = BigArrays.NON_RECYCLING_INSTANCE.withCircuitBreaking().newLongArray(underlyingArrayLength);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ protected Settings featureFlagSettings() {
}
// Enabling Telemetry setting by default
featureSettings.put(FeatureFlags.TELEMETRY_SETTING.getKey(), true);

// Enabling fuzzy set for tests by default
featureSettings.put(FeatureFlags.DOC_ID_FUZZY_SET_SETTING.getKey(), true);
return featureSettings.build();
}

Expand Down

0 comments on commit b898785

Please sign in to comment.