fx19880617 commented on a change in pull request #6020: URL: https://github.com/apache/incubator-pinot/pull/6020#discussion_r489717469
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/listener/ClusterLiveInstanceChangeListener.java ########## @@ -0,0 +1,34 @@ +package org.apache.pinot.controller.helix.core.listener; + +import java.util.ArrayList; +import org.apache.helix.HelixDataAccessor; +import org.apache.helix.NotificationContext; +import org.apache.helix.api.listeners.LiveInstanceChangeListener; +import org.apache.helix.model.LiveInstance; + +import java.util.List; +import org.apache.helix.PropertyKey.Builder; + + +public class ClusterLiveInstanceChangeListener implements LiveInstanceChangeListener { + private HelixDataAccessor _helixDataAccessor; + private Builder _keyBuilder; + private List<LiveInstance> _liveInstances = new ArrayList<>(); + + public ClusterLiveInstanceChangeListener(HelixDataAccessor helixDataAccessor, Builder keyBuilder) { + _helixDataAccessor = helixDataAccessor; + _keyBuilder = keyBuilder; + } + + @Override + public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { + _liveInstances = liveInstances; Review comment: _liveInstances = _helixDataAccessor.getProperty(_keyBuilder.liveInstances()); ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org