NealSun96 commented on code in PR #2099:
URL: https://github.com/apache/helix/pull/2099#discussion_r885970449


##########
helix-core/src/main/java/org/apache/helix/HelixPropertyFactory.java:
##########
@@ -80,20 +80,27 @@ public HelixManagerProperty getHelixManagerProperty(String 
zkAddress, String clu
    * @param clusterName
    * @return
    */
+
   public static CloudConfig getCloudConfig(String zkAddress, String 
clusterName) {
+    return getCloudConfig(zkAddress, clusterName, null);
+  }
+  public static CloudConfig getCloudConfig(String zkAddress, String 
clusterName,
+      RealmAwareZkClient.RealmAwareZkConnectionConfig 
realmAwareZkConnectionConfig) {
     CloudConfig cloudConfig;
     RealmAwareZkClient dedicatedZkClient = null;
     try {
       if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED) || zkAddress 
== null) {
         // If the multi ZK config is enabled or zkAddress is null, use 
realm-aware mode with
         // DedicatedZkClient
         try {
-          RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig =
-              new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder()
-                  .setRealmMode(RealmAwareZkClient.RealmMode.SINGLE_REALM)
-                  .setZkRealmShardingKey("/" + clusterName).build();
+          if (realmAwareZkConnectionConfig == null) {

Review Comment:
   I don't think a user should be allowed to pass in the null at all. If they 
don't have a config, they should use 
   ```
   getCloudConfig(String zkAddress, String clusterName)
   ```
   which would create a default for them. 
   
   If they have a config, they should then call the new function, and they are 
responsible for having a correct config. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to