krishan1390 opened a new pull request, #18800:
URL: https://github.com/apache/pinot/pull/18800

   ## Description
   
   Three small, backward-compatible broker extension points so subclasses / 
deployments can customize multi-stage
   query-thread estimation and observe segment ZK metadata, with no change to 
default behavior:
   
   1. 
**`DispatchableSubPlan#getEstimatedNumQueryThreads(ToIntFunction<String>)`** — 
a new overload that weights each
      leaf-stage segment by a caller-supplied work-unit count. The existing 
no-arg method delegates with a weight of `1`,
      so the default estimate is unchanged. This lets a caller account for a 
routed entry that represents more than one
      unit of server-side work, rather than always counting it as one.
   
   2. 
**`MultiStageBrokerRequestHandler#getEstimatedNumQueryThreads(DispatchableSubPlan)`**
 — the inline estimate at the
      throttle-acquire site is extracted into a `protected` method (default 
returns the existing value), so subclasses can
      override how the per-query server-thread estimate is computed.
   
   3. 
**`BaseBrokerRoutingManager#addSegmentZkMetadataFetchListenerProvider(Function<String,
 SegmentZkMetadataFetchListener>)`**
      — register additional per-table `SegmentZkMetadataFetchListener`s 
alongside the built-in segment pruners. They are
      fed from the `ZNRecord`s the routing manager already fetches, so a 
consumer can maintain routing-adjacent metadata
      caches with no extra ZooKeeper reads.
   
   All three are additive; existing call sites and default behavior are 
unchanged.
   
   ## Testing
   
   Existing `DispatchableSubPlanTest`, `MultiStageQueryThrottlerTest`, and 
broker routing tests pass. The new overload's
   default path is exercised by the existing no-arg estimate behavior (it 
delegates with a per-segment weight of 1).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to