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 2020/06/01 22:51:16 UTC

[GitHub] [helix] pkuwm commented on a change in pull request #1033: Add path existing check for customized state

pkuwm commented on a change in pull request #1033:
URL: https://github.com/apache/helix/pull/1033#discussion_r433529334



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1258,12 +1258,12 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
           if (lastInstances == null || !lastInstances.containsKey(instance)) {
             try {
               manager.addCustomizedStateRootChangeListener(this, instance);
-              logger.info(manager.getInstanceName() + " added customized root change listener for"
-                  + " " + instance
-                  + ", listener: " + this);
+              logger.info(manager.getInstanceName() + " added root path listener for customized "

Review comment:
       I understand you may want to keep logging as original. But since you are changing the logging code here, I suggest changing it to use parameterized logging: `logger.info("Hello {}", world);`. This parameterized logging has benefits of reduce string concatenation overhead when logging level info is not enabled, and easier to read in the code. Same as the other places in this PR.
   Nit, I realized this for loop needs unindent.

##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/CallbackHandler.java
##########
@@ -639,8 +638,13 @@ private void subscribeForChanges(NotificationContext.Type callbackType, String p
             }
           }
         } catch (ZkNoNodeException | HelixMetaDataAccessException e) {
-          logger.warn(
-              "fail to subscribe child/data change. path: " + path + ", listener: " + _listener, e);
+          if (_changeType == CUSTOMIZED_STATE_ROOT) {
+            logger.warn(
+                "fail to subscribe child/data change. path: " + path + ", listener: " + _listener);

Review comment:
       `fail to` -> `Failed to` ? Same for the others.




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