jiajunwang commented on a change in pull request #1355:
URL: https://github.com/apache/helix/pull/1355#discussion_r488322127
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -204,6 +204,13 @@ public void recordPathStat(Stat stat, OptionalLong
notificationTime) {
}
}
+ @Override
+ public String toString() {
Review comment:
Same thing here, it seems that directly refer to _uid is enough.
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/CallbackHandler.java
##########
@@ -660,24 +666,31 @@ private void subscribeForChanges(NotificationContext.Type
callbackType, String p
//TODO: avoid calling getChildren for path that does not exist
if (_changeType == CUSTOMIZED_STATE_ROOT) {
logger.warn(
- "Failed to subscribe child/data change on path: {}, listener:
{}. Instance "
- + "does not support Customized State!", path, _listener);
+ "CallbackHandler {}, Failed to subscribe child/data change on
path: {}, listener: {}. Instance "
+ + "does not support Customized State!", this.toString(),
path, _listener);
} else {
- logger.warn("Failed to subscribe child/data change. path: {},
listener: {}", path,
- _listener, e);
+ logger.warn("CallbackHandler {}, Failed to subscribe child/data
change. path: {}, listener: {}",
+ this.toString(), path, _listener, e);
}
}
}
}
long end = System.currentTimeMillis();
- logger.info("Subscribing to path: {} took: {}", path, (end - start));
+ logger.info("CallbackHandler{}, Subscribing to path: {} took: {}",
this.toString(), path, (end - start));
}
public EventType[] getEventTypes() {
return (EventType[]) _eventTypes.toArray();
}
+ @Override
+ public String toString() {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(_uid);
+ return stringBuilder.toString();
Review comment:
I agree to what Huizhi mentioned, please include the basic information.
If only uid is needed, then just refer to the _uid field in the code. No need
to override toString().
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -220,7 +227,7 @@ protected ZkClient(IZkConnection zkConnection, int
connectionTimeout, long opera
_asyncCallRetryThread = new ZkAsyncRetryThread(zkConnection.getServers());
_asyncCallRetryThread.start();
- LOG.debug("ZkClient created with _uid {}, _asyncCallRetryThread id {}",
_uid, _asyncCallRetryThread.getId());
+ LOG.debug("ZkClient created with _uid {}, _asyncCallRetryThread id {}",
this.toString(), _asyncCallRetryThread.getId());
Review comment:
nit "_uid" => "uid"
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -204,6 +204,13 @@ public void recordPathStat(Stat stat, OptionalLong
notificationTime) {
}
}
+ @Override
+ public String toString() {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(_uid);
Review comment:
I just notice that _uid here was not made final field, could you please
fix it? It should be a final field.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]