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 2022/04/01 18:14:32 UTC

[GitHub] [helix] qqu0127 commented on a change in pull request #2005: Populate helix cloud property using cloud config

qqu0127 commented on a change in pull request #2005:
URL: https://github.com/apache/helix/pull/2005#discussion_r840817884



##########
File path: helix-core/src/main/java/org/apache/helix/HelixManagerProperty.java
##########
@@ -66,11 +66,8 @@ private HelixManagerProperty(String version, long healthReportLatency,
   }
 
   public HelixCloudProperty getHelixCloudProperty() {
-    return _helixCloudProperty;
-  }
-
-  public void setHelixCloudProperty(CloudConfig cloudConfig) {
-    _helixCloudProperty = new HelixCloudProperty(cloudConfig);
+    return _helixCloudProperty == null ? HelixCloudProperty.EMPTY_HELIX_CLOUD_PROPERTY
+        : _helixCloudProperty;

Review comment:
       Thanks for the info.
   `it will still be assigned to null.` This is technically right, but is also the confusing part. Does a null value make sense or even be accessible at all? The public getter returns either the non-null assigned value, or an empty new instance. If possible, let's try to do the null check at assignment time. Also please let me know if I misunderstood anything.




-- 
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: reviews-unsubscribe@helix.apache.org

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