zhangmeng916 commented on a change in pull request #851: Modify Helix generic controller to include new stage for customized view aggregation URL: https://github.com/apache/helix/pull/851#discussion_r398114728
########## File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java ########## @@ -813,23 +817,36 @@ public void onStateChange(String instanceName, List<CurrentState> statesInfo, @Override @PreFetch(enabled = false) - public void onCustomizedStateRootChange(String instanceName, NotificationContext changeContext) { + public void onCustomizedStateRootChange(String instanceName, List<String> customizedStateTypes, + NotificationContext changeContext) { logger.info("START: GenericClusterController.onCustomizedStateRootChange()"); - notifyCaches(changeContext, ChangeType.CUSTOMIZED_STATE_ROOT); HelixManager manager = changeContext.getManager(); - List<String> customizedStateTypes = - manager.getHelixDataAccessor().getChildNames( - manager.getHelixDataAccessor().keyBuilder().customizedStatesRoot(instanceName)); + Builder keyBuilder = new Builder(manager.getClusterName()); - for (String customizedState : customizedStateTypes) { - try { - manager.addCustomizedStateChangeListener(this, instanceName, customizedState); - logger.info( - manager.getInstanceName() + " added customized state listener for " + instanceName - + ", listener: " + this); - } catch (Exception e) { - logger.error("Fail to add customized state listener for instance: " + instanceName, e); + synchronized (_lastSeenCustomizedStateTypes) { + Set<String> lastSeenCustomizedStateTypes = _lastSeenCustomizedStateTypes.get(); + for (String customizedState : customizedStateTypes) { Review comment: I made the change. However, I feel we actually do not need the prefetch logic for this event. It's redundant now. Please let me know. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For additional commands, e-mail: reviews-h...@helix.apache.org