javanna commented on code in PR #13602:
URL: https://github.com/apache/lucene/pull/13602#discussion_r1687812812
##########
lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithCollectorTask.java:
##########
@@ -46,17 +46,17 @@ public boolean withCollector() {
}
@Override
- protected Collector createCollector() throws Exception {
- Collector collector = null;
+ protected CollectorManager<?, ?> createCollectorManager() throws Exception {
+ CollectorManager<?, ?> collectorManager;
if (clnName.equalsIgnoreCase("topScoreDoc") == true) {
- collector = TopScoreDocCollector.create(numHits(), Integer.MAX_VALUE);
+ collectorManager = new TopScoreDocCollectorManager(numHits(),
Integer.MAX_VALUE);
} else if (clnName.length() > 0) {
- collector =
Class.forName(clnName).asSubclass(Collector.class).getConstructor().newInstance();
-
+ collectorManager =
+
Class.forName(clnName).asSubclass(CollectorManager.class).getConstructor().newInstance();
} else {
- collector = super.createCollector();
+ collectorManager = super.createCollectorManager();
}
- return collector;
+ return collectorManager;
Review Comment:
I am not familiar with this utility and I wonder if this type of change is
acceptable for a major release, whether there's other ways. If we continue down
this route, how do we document the breaking change, and should we deprecate
createCollector in the 9x branch?
Deprecating would only warn users that may be extending ReadTask, not sure
how common that would be. How would we want consumers of
SearchWithCollectorTask that rely on configuration? Perhaps handle exceptions
and provide a meaningful error message around the need to provide a collector
manager?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]