You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/01/25 21:24:42 UTC

[GitHub] [helix] zhangmeng916 commented on a change in pull request #1619: Allow cutomizing default rebalance configuration for the supercluster resources.

zhangmeng916 commented on a change in pull request #1619:
URL: https://github.com/apache/helix/pull/1619#discussion_r564050754



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
##########
@@ -1261,27 +1260,46 @@ public void addClusterToGrandCluster(String clusterName, String grandCluster) {
       throw new HelixException("Cluster " + clusterName + " is not setup yet");
     }
 
-    IdealState idealState = new IdealState(clusterName);
+    ZKHelixDataAccessor accessor =
+        new ZKHelixDataAccessor(grandCluster, new ZkBaseDataAccessor<>(_zkClient));
+    PropertyKey.Builder keyBuilder = accessor.keyBuilder();
+
+    ClusterConfig grandClusterConfig = accessor.getProperty(keyBuilder.clusterConfig());
+    RebalanceConfig superClusterRebalanceConfig =
+        grandClusterConfig.getSuperClusterRebalanceConfig();
+
+    // Note that the other rebalance configurations that are not verified below will be ignored.

Review comment:
       I'm confused about this comment here. Does the following check validate all possible scenarios or not? Do you mean "other configuration" as valid or invalid?

##########
File path: helix-core/src/test/java/org/apache/helix/model/TestClusterConfig.java
##########
@@ -393,4 +398,32 @@ private void trySetInvalidAbnormalStatesResolverMap(ClusterConfig testConfig,
       // expected
     }
   }
+
+  @Test
+  public void testSuperClusterRebalanceConfig() {
+    ClusterConfig testConfig = new ClusterConfig("testConfig");
+
+    // Check the default values
+    Assert.assertEquals(testConfig.getSuperClusterRebalanceConfig().getRebalanceStrategy(),
+        CrushEdRebalanceStrategy.class.getName());
+    Assert.assertEquals(testConfig.getSuperClusterRebalanceConfig().getRebalanceClassName(),
+        DelayedAutoRebalancer.class.getName());
+    Assert.assertEquals(testConfig.getSuperClusterRebalanceConfig().getRebalanceMode(),
+        RebalanceConfig.RebalanceMode.FULL_AUTO);
+
+    // Check set and read
+    RebalanceConfig rebalanceConfig = testConfig.getSuperClusterRebalanceConfig();
+    rebalanceConfig.setRebalanceClassName(WagedRebalancer.class.getName());

Review comment:
       Do we plan to also support REST API for this change? Feel that'll be very useful.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org