pkuwm commented on a change in pull request #644: Add new interface 
IZkStateListener to provide session aware handleNewSession for ZkHelixManager
URL: https://github.com/apache/helix/pull/644#discussion_r355297006
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkEventThread.java
 ##########
 @@ -38,16 +38,23 @@
 
   public static abstract class ZkEvent {
 
-    private String _description;
+    private final String _description;
+    private final String _sessionId;
 
     public ZkEvent(String description) {
+      this(description, null);
+    }
+
+    ZkEvent(String description, String sessionId) {
       _description = description;
+      _sessionId = sessionId;
     }
 
     public abstract void run() throws Exception;
 
-    @Override public String toString() {
-      return "ZkEvent[" + _description + "]";
+    @Override
+    public String toString() {
+      return "ZkEvent[description: " + _description + "; session: " + 
_sessionId + "]";
 
 Review comment:
   I considered that as String.format may look cleaner. But at the same time, 
String.format's performance is not as good as `+`. I think performance here is 
critical for the events as we want the event to be handled as fast as possible. 
So I decided to keep `+`.

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