Skip to content

Apache Lucene open-source search software

Remove supportsConcurrency constructors (#16833)

Luca Cavanna17c80dc1c326
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 65b85dc4a0d..edadbe27535 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -138,6 +138,10 @@ API Changes
* GITHUB#16834: Remove deprecated CharsRef.getUTF16SortedAsUTF8Comparator() method.
(Alan Woodward)
+* GITHUB#16833: Remove deprecated supportsConcurrency constructors from
+ TopFieldCollectorManager and TopScoreDocCollectorManager. The flag has been a
+ no-op since it was deprecated in 10.1. (Luca Cavanna)
+
New Features
---------------------
* GITHUB#16241: Add HangulCompositionCharFilter to analysis-nori for opt-in composition of
diff --git a/lucene/MIGRATE.md b/lucene/MIGRATE.md
index e3621e7bb08..34d74052557 100644
--- a/lucene/MIGRATE.md
+++ b/lucene/MIGRATE.md
@@ -104,6 +104,22 @@ List<GroupedFacetResult.FacetEntry> entries = result.getFacetEntries(offset, lim
`VectorValueSource` and its base class `MultiValueSource` have been removed without a replacement
+### `supportsConcurrency` constructors have been removed (GITHUB#16833)
+
+The `TopFieldCollectorManager` and `TopScoreDocCollectorManager` constructors that
+took a `boolean supportsConcurrency` argument have been removed. The flag has been
+a no-op since Lucene 10.1. Drop the last argument.
+
+```java
+// Before
+new TopScoreDocCollectorManager(numHits, after, totalHitsThreshold, true);
+new TopFieldCollectorManager(sort, numHits, after, totalHitsThreshold, false);
+
+// After
+new TopScoreDocCollectorManager(numHits, after, totalHitsThreshold);
+new TopFieldCollectorManager(sort, numHits, after, totalHitsThreshold);
+```
+
### Directory#copyFrom is now abstract (GITHUB#16530)
`Directory#copyFrom` no longer has a default implementation, so classes that extend
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
index e625400e855..904c1153582 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
@@ -33,30 +33,6 @@ public class TopFieldCollectorManager implements CollectorManager<TopFieldCollec
private final int totalHitsThreshold;
private final MaxScoreAccumulator minScoreAcc;
- /**
- * Creates a new {@link TopFieldCollectorManager} from the given arguments.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>.
- *
- * @param sort the sort criteria (SortFields).
- * @param numHits the number of results to collect.
- * @param after the previous doc after which matching docs will be collected.
- * @param totalHitsThreshold the number of docs to count accurately. If the query matches more
- * than {@code totalHitsThreshold} hits then its hit count will be a lower bound. On the other
- * hand if the query matches less than or exactly {@code totalHitsThreshold} hits then the hit
- * count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
- * count accurate, but this will also make query processing slower.
- * @param supportsConcurrency to use thread-safe and slower internal states for count tracking.
- * @deprecated Use {@link #TopFieldCollectorManager(Sort, int, FieldDoc, int)}, the
- * supportsConcurrency parameter is now a no-op.
- */
- @Deprecated
- public TopFieldCollectorManager(
- Sort sort, int numHits, FieldDoc after, int totalHitsThreshold, boolean supportsConcurrency) {
- this(sort, numHits, after, totalHitsThreshold);
- }
-
/**
* Creates a new {@link TopFieldCollectorManager} from the given arguments.
*
@@ -129,7 +105,7 @@ public class TopFieldCollectorManager implements CollectorManager<TopFieldCollec
* count accurate, but this will also make query processing slower.
*/
public TopFieldCollectorManager(Sort sort, int numHits, int totalHitsThreshold) {
- this(sort, numHits, null, totalHitsThreshold, true);
+ this(sort, numHits, null, totalHitsThreshold);
}
@Override
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
index f3117fdb881..1250c7428e7 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
@@ -32,35 +32,6 @@ public class TopScoreDocCollectorManager
private final int totalHitsThreshold;
private final MaxScoreAccumulator minScoreAcc;
- /**
- * Creates a new {@link TopScoreDocCollectorManager} given the number of hits to collect and the
- * number of hits to count accurately.
- *
- * <p><b>NOTE</b>: If the total hit count of the top docs is less than or exactly {@code
- * totalHitsThreshold} then this value is accurate. On the other hand, if the {@link
- * TopDocs#totalHits} value is greater than {@code totalHitsThreshold} then its value is a lower
- * bound of the hit count. A value of {@link Integer#MAX_VALUE} will make the hit count accurate
- * but will also likely make query processing slower.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>, and fill the array with sentinel objects.
- *
- * @param numHits the number of results to collect.
- * @param after the previous doc after which matching docs will be collected.
- * @param totalHitsThreshold the number of docs to count accurately. If the query matches more
- * than {@code totalHitsThreshold} hits then its hit count will be a lower bound. On the other
- * hand if the query matches less than or exactly {@code totalHitsThreshold} hits then the hit
- * count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
- * count accurate, but this will also make query processing slower.
- * @deprecated Use {@link #TopScoreDocCollectorManager(int, ScoreDoc, int)}, the
- * supportsConcurrency parameter is now a no-op.
- */
- @Deprecated
- public TopScoreDocCollectorManager(
- int numHits, ScoreDoc after, int totalHitsThreshold, boolean supportsConcurrency) {
- this(numHits, after, totalHitsThreshold);
- }
-
/**
* Creates a new {@link TopScoreDocCollectorManager} given the number of hits to collect and the
* number of hits to count accurately, with thread-safe internal states.
@@ -120,7 +91,7 @@ public class TopScoreDocCollectorManager
* count accurate, but this will also make query processing slower.
*/
public TopScoreDocCollectorManager(int numHits, int totalHitsThreshold) {
- this(numHits, null, totalHitsThreshold, true);
+ this(numHits, null, totalHitsThreshold);
}
@Override