Jackie-Jiang commented on a change in pull request #6208:
URL: https://github.com/apache/incubator-pinot/pull/6208#discussion_r514504975



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java
##########
@@ -126,47 +128,28 @@ public void onInstancesChange(Set<String> 
enabledInstances, List<String> changed
    * {@inheritDoc}
    *
    * <p>Updates the cached maps ({@code segmentToOnlineInstancesMap}, {@code 
segmentToOfflineInstancesMap} and
-   * {@code instanceToSegmentsMap}) based on the given ExternalView and 
re-calculates
-   * {@code segmentToEnabledInstancesMap} and {@code unavailableSegments} 
based on the cached states.
+   * {@code instanceToSegmentsMap}) and re-calculates {@code 
segmentToEnabledInstancesMap} and
+   * {@code unavailableSegments} based on the cached states.
    */
   @Override
-  public void onExternalViewChange(ExternalView externalView, Set<String> 
onlineSegments) {
-    Map<String, Map<String, String>> segmentAssignment = 
externalView.getRecord().getMapFields();
-    int numSegments = segmentAssignment.size();
-    _segmentToOnlineInstancesMap = new 
HashMap<>(HashUtil.getHashMapCapacity(numSegments));
-    _segmentToOfflineInstancesMap = new 
HashMap<>(HashUtil.getHashMapCapacity(numSegments));
+  public void onExternalViewChange(ExternalView externalView, IdealState 
idealState, Set<String> onlineSegments) {

Review comment:
       `onlineSegments` are derived from the `idealState`, but also filtered by 
the pre-selector, so we need to pass both of them




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

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