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

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/client/HelixZkClient.java
 ##########
 @@ -6,12 +6,12 @@
 import org.I0Itec.zkclient.DataUpdater;
 import org.I0Itec.zkclient.IZkChildListener;
 import org.I0Itec.zkclient.IZkDataListener;
-import org.I0Itec.zkclient.IZkStateListener;
 import org.I0Itec.zkclient.serialize.SerializableSerializer;
 import org.I0Itec.zkclient.serialize.ZkSerializer;
 import org.apache.helix.manager.zk.BasicZkSerializer;
 import org.apache.helix.manager.zk.PathBasedZkSerializer;
 import org.apache.helix.manager.zk.ZkAsyncCallbacks;
+import org.apache.helix.manager.zk.zookeeper.IZkStateListener;
 
 Review comment:
   As we discussed, let's do the following default method, so no one need to 
change code. And we are backward compatible.
   
     default void subscribeStateChanges(final IZkStateListener listener) {
   
       subscribeStateChanges(new IZkStateListener() {
         @Override
         public void handleStateChanged(Watcher.Event.KeeperState state)
             throws Exception {
   
         }
   
         @Override
         public void handleNewSession(Session)
             throws Exception {
           listener.handleNewSession();
         }
   
         @Override
         public void handleSessionEstablishmentError(Throwable error)
             throws Exception {
   
         }
       }
     }

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