pkuwm commented on a change in pull request #644: Customize IZkStateListener to 
add handleNewSession(sessionId)
URL: https://github.com/apache/helix/pull/644#discussion_r354952718
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/client/HelixZkClient.java
 ##########
 @@ -148,6 +189,36 @@ void asyncSetData(final String path, Object datat, final 
int version,
 
   PathBasedZkSerializer getZkSerializer();
 
+  /**
+   * Creates a {@link org.I0Itec.zkclient.IZkStateListener} that wraps a 
default implementation
+   * of {@link org.apache.helix.manager.zk.zookeeper.IZkStateListener}, which 
means the returned
+   * listener runs the methods of {@link 
org.apache.helix.manager.zk.zookeeper.IZkStateListener}.
+   * This is for backwards compatibility and to avoid breaking the original 
implementation of
+   * {@link org.I0Itec.zkclient.IZkStateListener}.
+   *
+   * @param listener {@link 
org.apache.helix.manager.zk.zookeeper.IZkStateListener}
+   * @return {@link org.I0Itec.zkclient.IZkStateListener}
+   */
+  static IZkStateListener createDefaultIZkStateListener(
 
 Review comment:
   I was considering this. My thought was:
   1. If we import the new listener, we have to change 
`subscribeStateChanges(final IZkStateListener listener)` to 
`subscribeStateChanges(final org.I0Itec.zkclient.IZkStateListener listener)` as 
well. I was trying to keep the changes minimal, and make the default method 
`default void subscribeStateChanges(final 
org.apache.helix.manager.zk.zookeeper.IZkStateListener listener)` look like a 
new method with more distinction.
   2. If we don't have other I0Itec imports in this interface, I believe it 
looks cleaner to just import our own listener. So we could completely get rid 
of I0Itec in this interface.
   
   This is just my thought. We can also involve @jiajunwang @lei-xia to comment.

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