You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2025/02/21 13:28:23 UTC
(lucene) branch main updated: Fix test failure in TestHistogramCollectorManager
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new e779e55515c Fix test failure in TestHistogramCollectorManager
e779e55515c is described below
commit e779e55515cfca533a507c63883a92fc50cee459
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Fri Feb 21 14:27:36 2025 +0100
Fix test failure in TestHistogramCollectorManager
---
.../lucene/sandbox/facet/plain/histograms/HistogramCollector.java | 2 +-
.../sandbox/facet/plain/histograms/HistogramCollectorManager.java | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollector.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollector.java
index 7c3bbb26530..722e03ab08f 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollector.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollector.java
@@ -262,7 +262,7 @@ final class HistogramCollector implements Collector {
}
}
- private static void checkMaxBuckets(int size, int maxBuckets) {
+ static void checkMaxBuckets(int size, int maxBuckets) {
if (size > maxBuckets) {
throw new IllegalStateException(
"Collected "
diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollectorManager.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollectorManager.java
index a97d27e1c75..f00b8b7d5be 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollectorManager.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/facet/plain/histograms/HistogramCollectorManager.java
@@ -89,6 +89,7 @@ public final class HistogramCollectorManager
for (HistogramCollector collector : collectors) {
for (LongIntCursor cursor : collector.getCounts()) {
reduced.addTo(cursor.key, cursor.value);
+ HistogramCollector.checkMaxBuckets(reduced.size(), maxBuckets);
}
}
return reduced;