You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ji...@apache.org on 2019/10/07 21:12:16 UTC
[helix] 13/37: Modify the expected change type from CONFIG to
CLUSTER_CONFIG in the WAGED rebalancer. (#438)
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 2780fd99d0347af4eef08c293db7741c422c8af8
Author: Jiajun Wang <18...@users.noreply.github.com>
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()