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



##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/RealmAwareZkClient.java
##########
@@ -71,10 +71,14 @@
   // listener subscription
   List<String> subscribeChildChanges(String path, IZkChildListener listener);
 
+  List<String> subscribeChildChanges(String path, IZkChildListener listener, 
boolean skipWatchingNodeNotExist);

Review comment:
       This is a public interface And HelixZkClient also extends it, do we need 
a default implementation for backward compatibility?

##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -257,12 +274,22 @@ public void subscribeDataChanges(String path, 
IZkDataListener listener) {
         }
       }
     }
-    watchForData(path);
+

Review comment:
       Agreed. Maybe we could do this: add listeners first. If watch fails, we 
remove listeners?

##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1270,6 +1325,9 @@ public void deleteRecursively(String path) throws 
ZkClientException {
   private void processDataOrChildChange(WatchedEvent event, long 
notificationTime) {
     final String path = event.getPath();
     final boolean pathExists = event.getType() != EventType.NodeDeleted;
+    if (EventType.NodeDeleted == event.getType()) {
+      LOG.info("event delelete:" + event.getPath());

Review comment:
       Is this log necessary? May pollute the logs?

##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1858,24 +1923,47 @@ public Object call() throws Exception {
     });
   }
 
+  private boolean watchForData(final String path, boolean 
skipWatchingNodeNotExist) {
+    try {
+      if (skipWatchingNodeNotExist) {
+        Stat stat = new Stat();

Review comment:
       No need to get stat? Passing null is enough.




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

Reply via email to