gsmiller commented on code in PR #17019:
URL: https://github.com/apache/lucene/pull/17019#discussion_r4688697476
##########
lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java:
##########
@@ -89,18 +100,24 @@ private static int getNearestSetSize(int maxNumberOfBits) {
}
public static FuzzySet createSetBasedOnMaxMemory(int maxNumBytes) {
- int setSize = getNearestSetSize(maxNumBytes * Byte.SIZE);
+ int setSize = getNearestSetSize((long) maxNumBytes * Byte.SIZE);
return new FuzzySet(new FixedBitSet(setSize + 1), setSize, 1);
}
+ /**
+ * Returns a set sized to hold maxNumUniqueValues at no worse than
targetMaxFpp.
+ *
+ * <p>The target is best effort: a value count needing more bits than this
class can address gets
+ * the largest available set, 2^30 bits, whose false-positive rate is worse
than requested.
Review Comment:
I'd prefer to keep the filter but will add to the javadoc. I'd rather not
try to make a judgement call here about the point at which the memory vs.
fp-rate tradeoff doesn't make sense for a user. But warning about this in the
javadoc is fair.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]