You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/05/18 18:17:34 UTC

[GitHub] [lucene] mikemccand commented on a change in pull request #143: LUCENE-9962: Allow DrillSideways sub-classes to provide their own "drill down" facet counting implementation (or null).

mikemccand commented on a change in pull request #143:
URL: https://github.com/apache/lucene/pull/143#discussion_r634636938



##########
File path: lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java
##########
@@ -124,16 +124,34 @@ public DrillSideways(
     this.executor = executor;
   }
 
+  /**
+   * Subclass can override to customize drill down facets collector. Returning {@code null} is valid
+   * if no drill down facet collection is needed.
+   */
+  protected FacetsCollector createDrillDownFacetsCollector() {
+    return new FacetsCollector();
+  }
+
+  /**
+   * Subclass can override to customize drill down facets collector. Returning {@code null} is valid
+   * if no drill down facet collection is needed.
+   */
+  protected FacetsCollectorManager createDrillDownFacetsCollectorManager() {
+    return new FacetsCollectorManager();
+  }
+
   /** Subclass can override to customize per-dim Facets impl. */
   protected Facets buildFacetsResult(
       FacetsCollector drillDowns, FacetsCollector[] drillSideways, String[] drillSidewaysDims)
       throws IOException {
 
-    Facets drillDownFacets;
+    Facets drillDownFacets = null;

Review comment:
       Hmm, I wonder why you needed to do this?  I would think `javac` would realize this local variable is fully initialized regardless of which way the conditionals go below, both before and after this change.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org