This is an automated email from the ASF dual-hosted git repository.
jiajunwang pushed a commit to branch wagedRebalancer
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/wagedRebalancer by this push:
new 28e6fdd Modify the expected change type from CONFIG to CLUSTER_CONFIG
in the WAGED rebalancer. (#438)
28e6fdd is described below
commit 28e6fdd7af6d5d1cf072e123e190a367ea363411
Author: Jiajun Wang <[email protected]>
AuthorDate: Thu Aug 29 10:48:38 2019 -0700
Modify the expected change type from CONFIG to CLUSTER_CONFIG in the WAGED
rebalancer. (#438)
CONFIG is for generic configuration items. That will be too generic for the
rebalancer.
Modify to check for CLUSTER_CONFIG to avoid confusion.
---
.../helix/controller/rebalancer/waged/model/ClusterModelProvider.java | 2 +-
.../controller/rebalancer/waged/model/TestClusterModelProvider.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
b/helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
index c4f7d02..e0a5e35 100644
---
a/helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
+++
b/helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
@@ -112,7 +112,7 @@ public class ClusterModelProvider {
Map<String, ResourceAssignment> bestPossibleAssignment,
Map<String, Set<AssignableReplica>> allocatedReplicas) {
Set<AssignableReplica> toBeAssignedReplicas = new HashSet<>();
- if (clusterChanges.containsKey(HelixConstants.ChangeType.CONFIG)
+ if (clusterChanges.containsKey(HelixConstants.ChangeType.CLUSTER_CONFIG)
||
clusterChanges.containsKey(HelixConstants.ChangeType.INSTANCE_CONFIG)) {
// If the cluster topology has been modified, need to reassign all
replicas
toBeAssignedReplicas
diff --git
a/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/model/TestClusterModelProvider.java
b/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/model/TestClusterModelProvider.java
index 1221b6f..638182f 100644
---
a/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/model/TestClusterModelProvider.java
+++
b/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/model/TestClusterModelProvider.java
@@ -177,7 +177,7 @@ public class TestClusterModelProvider extends
AbstractTestClusterModel {
// 5. test with best possible assignment but cluster topology is changed
clusterModel = ClusterModelProvider.generateClusterModel(testCache,
_resourceNames.stream()
.collect(Collectors.toMap(resource -> resource, resource -> new
Resource(resource))),
- _instances, Collections.singletonMap(HelixConstants.ChangeType.CONFIG,
+ _instances,
Collections.singletonMap(HelixConstants.ChangeType.CLUSTER_CONFIG,
Collections.emptySet()), Collections.emptyMap(),
bestPossibleAssignment);
// There should be no existing assignment since the topology change
invalidates all existing assignment
Assert.assertTrue(clusterModel.getContext().getAssignmentForFaultZoneMap().values().stream()