yashmayya opened a new pull request, #19124:
URL: https://github.com/apache/pinot/pull/19124
## Summary
Removes 13 classes that are not reachable from any production or test code.
This is a deletion-only change: no behavior changes, no signature changes, and
nothing added.
For a deletion-only PR the dead-code criterion is the only thing a reviewer
can really check, so the method and the per-file provenance are documented
below.
## How "dead" was established
For each class, and for each of its distinctive public members:
- `git grep` over **all** file types in the tracked index — not just
`.java`, but poms, assembly/shade descriptors, `META-INF/services`, resource
and XML configs, TestNG suite files, `.github/` workflows, `pinot-perf` JMH
sources, and the Scala connectors.
- Reflective and `ServiceLoader` acquisition ruled out explicitly: none of
these names appears as a string literal anywhere, and the repo's classpath
scans target `PartitionFunction`, `@ScalarFunction`, `QuickStartBase` and
specific SPI interfaces — none of which matches a deleted class.
- `git log -S` to find the commit that removed the last call site, so each
deletion has a traceable cause rather than just an absence.
Compile-verified with `test-compile` across `pinot-core`,
`pinot-segment-local`, `pinot-query-planner`, `pinot-query-runtime`,
`pinot-broker`, `pinot-server`, `pinot-perf` and `pinot-integration-tests`
(`-am`). Spotless, Checkstyle and license checks pass on the three touched
modules.
> Note for anyone reproducing this: plain `grep -r` in a working copy
respects gitignore and will silently skip `.claude/worktrees/`, which can hold
full checkouts of these same files. Use `git grep --cached` and verify with a
positive control.
## What is removed, and what orphaned it
| Class | LOC | Orphaned by |
|---|---|---|
| `IntObjectIndexedPriorityQueue` (+ test) | 401 | no callers since the
`com.linkedin` era (2018) |
| `IntDoubleIndexedPriorityQueue` (+ test) | 390 | no callers since the
`com.linkedin` era (2018) |
| `BaseIndexedPriorityQueue` | 104 | abstract parent of the two above; no
other subclasses |
| `HnswDocIdCollector` | 88 | #18168 |
| `ParentToChildrenStageCalculator` | 56 | never referenced — added unused
by #14296 |
| `LookupRecordLocation` | 50 | #15130 |
| `NumValuesInfo` | 41 | #10199 |
| `EmptyFilterBlock` | 37 | #11185 |
| `ValidDocIndexReaderImpl` | 37 | upsert reader refactor |
| `SizeUtil` | 36 | no remaining callers |
| `TimerService` | 29 | missed by the HLC cleanup in #11326 |
`TimerService` is worth singling out: it held a `static Timer`, so any
future reference would have eagerly spawned a daemon thread named
`RealtimeIndexingSegmentDataManager` for a consumer type removed three years
ago.
`NumValuesInfo` had also silently diverged from the live
`MutableSegmentImpl.ValuesInfo` it was forked from (`_maxNumValuesPerMVEntry`
initialised to `0` vs `-1`), so removing it eliminates a copy-paste hazard.
## Two files that deserve reviewer attention
**`HnswDocIdCollector`** — this is the only one of the 13 that was recently
active, so it got extra scrutiny. #17884 added a
`QueryThreadContext.checkTerminationAndSampleUsagePeriodically(...)` hook to it
on 2026-04-02; #18168 then rewrote the HNSW search path three days later and
orphaned the class.
The deletion itself is behaviour-neutral: the live path in
`LuceneHnswRuntimeControlUtils` uses a score-aware `KnnCollector` bounded by
`efSearch`/`visitLimit`, and a score-ignoring `Collector` is fundamentally
incompatible with top-K KNN — it cannot be reinstated as-is.
Separately, and **pre-existing on master rather than caused by this PR**:
`checkTerminationAndSampleUsagePeriodically` now has zero call sites under
`.../index/readers/vector/`, while the sibling text/JSON Lucene paths
(`LuceneDocIdCollector`, `RealtimeLuceneDocIdCollector`,
`ImmutableJsonIndexReader`) retain it. So HNSW vector search appears to have
lost per-query termination checks and usage accounting when the path was
rewritten. Graph traversal is still bounded by `efSearch`/`visitLimit`, so this
is not unbounded work, but it is a real gap. I'd rather not fix it inside a
deletion-only PR — happy to follow up, or to drop this file from the PR if a
vector-search owner prefers to sequence the restore first.
**`ParentToChildrenStageCalculator`** — born dead. Its entire history is a
single commit, #14296 ("[spool] Define equivalence between stages"), and it was
never referenced then or since, while its siblings `EquivalentStagesFinder` and
`GroupedStages` are live and spool work continued in #14507 / #15024 / #18752.
Deletion looks right, but flagging in case it was being held for pending spool
follow-ups.
Either file can be dropped from this PR without affecting the other eleven.
## Deliberately left alone
- **`ValidDocIndexReader`** (`pinot-segment-spi`) — after removing
`ValidDocIndexReaderImpl` this interface has no in-tree implementations. It is
kept anyway: `pinot-segment-spi` is covered by the `binary-compat-check` job,
and dropping a public SPI type is exactly the break that gate exists to catch.
That belongs in a separate, explicitly labelled backward-incompatible change,
not a dead-code sweep.
- **`Pairs.IntDoublePair` / `IntDoubleComparator` / `IntObjectPair` /
`IntObjectComparator`** (`pinot-spi`) — these lose their last in-tree consumers
here. Same reasoning: public `pinot-spi` nested types, so they want a
deprecation cycle rather than being swept in silently. `Pairs.IntPair` is
unaffected and still widely used.
## Testing
No new tests: nothing is added, and every deleted class had zero reachable
callers. The two removed tests (`IntObjectIndexedPriorityQueueTest`,
`IntDoubleIndexedPriorityQueueTest`) covered only the classes deleted alongside
them.
Verification is the compile matrix above plus the reference sweep; existing
suites in the touched modules are unaffected because no surviving code
referenced any of these types.
--
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]