You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gs...@apache.org on 2026/01/09 18:18:30 UTC

(lucene) branch branch_10x updated: Deprecate some public FuzzySet methods ahead of removing them in a future release (#15559)

This is an automated email from the ASF dual-hosted git repository.

gsmiller pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_10x by this push:
     new 317cee32be6 Deprecate some public FuzzySet methods ahead of removing them in a future release (#15559)
317cee32be6 is described below

commit 317cee32be6d550b65421b9865b5c17b568232ef
Author: Greg Miller <gs...@gmail.com>
AuthorDate: Fri Jan 9 10:18:24 2026 -0800

    Deprecate some public FuzzySet methods ahead of removing them in a future release (#15559)
---
 lucene/CHANGES.txt                                  |  2 ++
 .../org/apache/lucene/codecs/bloom/FuzzySet.java    | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 1dd2508c2b3..66ec78f553d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -37,6 +37,8 @@ API Changes
 
 * GITHUB#15514: Refactor DocValuesSkipper stat methods to accept IndexReader instead of IndexSearcher (Pan Guixin)
 
+* GITHUB#15559: Deprecate some public FuzzySet methods ahead of removing them in the future (Greg Miller)
+
 New Features
 ---------------------
 * GITHUB#15328: VectorSimilarityFunction.getValues() now implements doubleVal allowing its
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java b/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java
index 9e5b0d7fee7..b2ece8d9b50 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java
@@ -77,7 +77,11 @@ public class FuzzySet implements Accountable {
   /**
    * Rounds down required maxNumberOfBits to the nearest number that is made up of all ones as a
    * binary number. Use this method where controlling memory use is paramount.
+   *
+   * @deprecated public visibility of this method will be removed in a future release; this is meant
+   *     for internal use only
    */
+  @Deprecated
   public static int getNearestSetSize(int maxNumberOfBits) {
     int result = usableBitSetSizes[0];
     for (int i = 0; i < usableBitSetSizes.length; i++) {
@@ -95,7 +99,9 @@ public class FuzzySet implements Accountable {
    * @param desiredSaturation A number between 0 and 1 expressing the % of bits set once all values
    *     have been recorded
    * @return The size of the set nearest to the required size
+   * @deprecated this method will be removed in a future release
    */
+  @Deprecated
   public static int getNearestSetSize(int maxNumberOfValuesExpected, float desiredSaturation) {
     // Iterate around the various scales of bitset from smallest to largest looking for the first
     // that
@@ -117,6 +123,11 @@ public class FuzzySet implements Accountable {
     return new FuzzySet(new FixedBitSet(setSize + 1), setSize, 1);
   }
 
+  /**
+   * @deprecated this ctor will be removed in a future release; please see {@link
+   *     #createOptimalSet(int, float)} for an improved initialization approach
+   */
+  @Deprecated
   public static FuzzySet createSetBasedOnQuality(
       int maxNumUniqueValues, float desiredMaxSaturation, int version) {
     int setSize = getNearestSetSize(maxNumUniqueValues, desiredMaxSaturation);
@@ -276,7 +287,12 @@ public class FuzzySet implements Accountable {
   /**
    * Given a set size and the number of set bits, produces an estimate of the number of unique
    * values recorded (assuming a single hash function is used)
+   *
+   * @deprecated this method will be removed in a future release; see {@link
+   *     #getEstimatedUniqueValues()} for an alternative based on an actual {@code FuzzySet}
+   *     instance
    */
+  @Deprecated
   public static int getEstimatedNumberUniqueValuesAllowingForCollisions(
       int setSize, int numRecordedBits) {
     return getEstimatedNumberUniqueValuesAllowingForCollisions(setSize, numRecordedBits, 1);
@@ -285,7 +301,12 @@ public class FuzzySet implements Accountable {
   /**
    * Given a set size, the number of set bits and hash function count, produces an estimate of the
    * number of unique values recorded
+   *
+   * @deprecated this method will be removed in a future release; see {@link
+   *     #getEstimatedUniqueValues()} for an alternative based on an actual {@code FuzzySet}
+   *     instance
    */
+  @Deprecated
   public static int getEstimatedNumberUniqueValuesAllowingForCollisions(
       int setSize, int numRecordedBits, int hashCount) {
     double setSizeAsDouble = setSize;