Jackie-Jiang opened a new pull request, #19068:
URL: https://github.com/apache/pinot/pull/19068

   ## Summary
   
   `TableRebalancer.getMovingConsumingSegments` identified a consuming segment 
to be moved with two stream passes over the target instance state map — 
`values().stream().noneMatch(ONLINE)` and 
`values().stream().anyMatch(CONSUMING)` — allocating stream pipelines per 
segment across the whole table.
   
   A realtime segment's replicas are never a mix of `ONLINE` and `CONSUMING`: a 
segment is either consuming or completed, and completion flips the whole 
segment at once. So a `CONSUMING` replica in the target already implies no 
replica is `ONLINE`, and the check collapses to a single 
`Map.containsValue(CONSUMING)`. This drops the stream allocation and the 
redundant `noneMatch(ONLINE)` pass. The assumption is documented on the method.
   
   Behavior is unchanged for all realistic inputs. The unit test case that 
constructed an `ONLINE` + `CONSUMING` mix (which the assumption forbids) is 
replaced with a fully-`OFFLINE` segment so the "no `CONSUMING` replica → not 
moved" path is still exercised.
   


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