Refactor doc values to expose a DocIdSetIterator instead of extending DocIdSetIterator.#14475
Refactor doc values to expose a DocIdSetIterator instead of extending DocIdSetIterator.#14475jpountz wants to merge 1 commit intoapache:mainfrom
DocIdSetIterator instead of extending DocIdSetIterator.#14475Conversation
…ng `DocIdSetIterator`. This should help reduce polymorphism of `DocIdSetIterator` as doc values would then only expose 2 classes as `DocIdSetIterator`s: dense iterators and `IndexedDISI` for the sparse case. This change almost only touches implementations of doc values, a separate change would be needed to fix call sites of `docValues#nextDoc()` and similar `DocIdSetIterator` APIs to go throu `docValues#iterator()` instead. Relates apache#14450
|
I like the idea! Think out loud: |
|
Indeed I agree that it is not great the way it is. I was actually thinking of going one step further compared with your suggestion and adding The benefit of adding |
+1 for this approach, thanks for sharing and explanation! |
|
It occurs to me that logic like: now seems problematic, because the default implementation of +1 again to change the contract, let's make |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
This should help reduce polymorphism of
DocIdSetIteratoras doc values would then only expose 2 classes asDocIdSetIterators: dense iterators andIndexedDISIfor the sparse case.This change almost only touches implementations of doc values, a separate change will be needed to fix call sites of
docValues#nextDoc()and similarDocIdSetIteratorAPIs to go throughdocValues#iterator()instead.Relates #14450