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_r398115507
##########
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();
Review comment:
I saw a todo here:
// TODO: remove the synchronization here once we move this update into
dataCache.
synchronized (_lastSeenInstances) {
I'm not sure whether there's any pending task for this that could also apply
here, so I kept it.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]