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:26 UTC

(lucene) branch branch_10x updated: Fix test failure in TestHistogramCollectorManager

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

jpountz 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 9558b1d0a42 Fix test failure in TestHistogramCollectorManager
9558b1d0a42 is described below

commit 9558b1d0a42dbd7f814901456ec795bd70ddba40
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;