lucene
lucene copied to clipboard
LUCENE-10001: Make CollectionTerminatedException handling in MultiCollector configurable
Description
There could be use-cases where a user wants to terminate all wrapped collectors in a MultiCollector when one terminates. Today, other collectors continue collecting. For example, a user collecting matching docs while also collecting into a FacetsCollector may want to terminate both collectors when the "main" matching docs collector terminates.
#11040
Solution
Added the ability to configure the behavior through an enum specified to wrap
Tests
Updated the existing tests to check behavior under both options.
Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
- [x] I have created a Jira issue and added the issue ID to my pull request title.
- [x] I have given Lucene maintainers access to contribute to my PR branch. (optional but recommended)
- [x] I have developed this patch against the
main
branch. - [x] I have run
./gradlew check
. - [x] I have added tests for my changes.
@gautamworah96 thanks for the feedback! Adrien and I have been having some conversation around whether-or-not this change makes sense over in the Jira issue. As a result, I'm going to try out a little bit of a different approach next, but I appreciate your comments here and will work them in as possible in my next revision. Thanks again!
I've put this in "Draft" state for now after a suggestion over on the Jira issue to approach this differently. I'll update here (and take out of "Draft") once I've had a chance to explore a different approach. Thanks everyone for the comments so far!
@gsmiller what should we do with this PR? Are you working on the alternative (wrapping?) approach? Should we close this PR and later open that approach? Or leave this one open...? Thanks.
@mikemccand I'm going to close this out. I haven't worked on this in a while now. Thanks for the ping!