apache / apache/lucene

Remove the last PriorityQueue subclasses

Open
#14,872 2 comments 0 reactions 0 assignees View on GitHub
type:task
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

After the various PRs changing `PriorityQueue` to use `Comparator` or `LessThan` functional interfaces, there are only a few subclasses remaining before we can make `PriorityQueue` final:

* `TermsMergeQueue`. This has some additional state in the stack variable
* `FieldValueHitQueue`. This is further subclassed, and is public (although experimental)
* `HitQueue`. Public class (although internal). Used in several difference places, so this class represents some common functionality.
* `TopDocs.ScoreMergeSortQueue`, `TopDocs.MergeSortQueue`. Has some significant state fields in them
* `TopOrdAndNumberQueue` and subclasses. Part of the public API, and has some abstract behavious set by subclasses
* `SuggestWordQueue`. Public API

How should we handle these?

Contributor guide

Open the contributing guide

Research direction

Start by reading the remaining PriorityQueue subclasses named in the issue: TermsMergeQueue, FieldValueHitQueue, HitQueue, the TopDocs merge queues, TopOrdAndNumberQueue, and SuggestWordQueue. Trace their subclasses, state, and public API usage to determine how each should be handled before PriorityQueue can become final. Done requires an agreed approach for all listed exceptions; no specific files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.