KKcorps opened a new pull request, #18645:
URL: https://github.com/apache/pinot/pull/18645
## Description
Subclasses of `WorkerManager` can already customize multi-stage leaf-stage
worker selection by overriding
`getCandidateServers` / `getCandidateServersForReplicatedLeaf`, but the
per-worker **segment** assignment is finalized
internally with no extension point to adjust it.
This PR adds two `protected` no-op extension points, invoked once the
leaf-stage segment assignment has been built:
- `filterLeafStageSegments(DispatchablePlanContext,
DispatchablePlanMetadata)` — invoked from
`updateContextForLeafStage`, which the non-partitioned, partitioned, and
logical-table leaf paths all funnel through.
- `filterReplicatedLeafStageSegments(DispatchablePlanContext,
DispatchablePlanMetadata)` — invoked from
`setSegmentsForReplicatedLeafFragment` for the replicated (broadcast) leaf
path.
A subclass can rewrite `DispatchablePlanMetadata#getWorkerIdToSegmentsMap()`
/ `#getReplicatedSegments()` through the
existing setters — for example to apply a custom segment-pruning policy —
with access to the query options via
`DispatchablePlanContext#getPlannerContext().getOptions()`.
## Backward compatibility
Purely additive. Both hooks default to no-ops, so behavior is unchanged for
the base `WorkerManager` and all existing
subclasses.
## Testing
Existing multi-stage planning / `WorkerManager` tests continue to pass; the
hooks are no-ops by default.
## Release notes
No behavior change — new `protected` extension points only.
--
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]