This is an automated email from the ASF dual-hosted git repository. jiajunwang pushed a commit to branch wagedRebalancer2 in repository https://gitbox.apache.org/repos/asf/helix.git
commit eb7a0107629c09d6276a35e122c9d3b7049d0f51 Author: Hunter Lee <[email protected]> AuthorDate: Thu Aug 29 12:40:05 2019 -0700 Add special treatment for ClusterConfig This diff allows callers of getChangeType to iterate over the result of getChangeType() by changing determinePropertyMapByType so that it just returns an empty map for ClusterConfig. --- .../helix/controller/changedetector/ResourceChangeDetector.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeDetector.java b/helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeDetector.java index 611f4b2..a154af2 100644 --- a/helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeDetector.java +++ b/helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeDetector.java @@ -111,11 +111,14 @@ public class ResourceChangeDetector implements ChangeDetector { return snapshot.getResourceConfigMap(); case LIVE_INSTANCE: return snapshot.getLiveInstances(); - case CONFIG: + case CLUSTER_CONFIG: + // In the case of ClusterConfig, we return an empty map + // This is to allow the caller to iterate on the change types without throwing an exception or + // leaving a warn log for ClusterConfig changes return Collections.emptyMap(); default: LOG.warn( - "ResourceChangeDetector cannot compute the names of changes for the given ChangeType: {}", + "ResourceChangeDetector cannot determine propertyMap for the given ChangeType: {}. Returning an empty map.", changeType); return Collections.emptyMap(); }
