jiajunwang commented on a change in pull request #647: Add java API to create 
cluster with CloudConfig
URL: https://github.com/apache/helix/pull/647#discussion_r359067811
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
 ##########
 @@ -1025,6 +1026,25 @@ public void dropResource(String clusterName, String 
resourceName) {
     accessor.removeProperty(keyBuilder.resourceConfig(resourceName));
   }
 
+  @Override
+  public void addCloudConfig(String clusterName, CloudConfig cloudConfig) {
+    logger.info("Add CloudConfig to cluster {}, CloudConfig is {}.", 
clusterName,
+        cloudConfig.toString());
+
+    if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
+      throw new HelixException("cluster " + clusterName + " is not setup yet");
+    }
+
+    CloudConfig.Builder builder = new CloudConfig.Builder(cloudConfig);
 
 Review comment:
   Why do we need to copy build a new object for this logic? If it is for 
validation, please make that method callable here. A builder should not be used 
for validation.

----------------------------------------------------------------
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]

Reply via email to