eolivelli commented on a change in pull request #1106: ZOOKEEPER-1416 - 
Persistent, recursive watchers
URL: https://github.com/apache/zookeeper/pull/1106#discussion_r330880369
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
 ##########
 @@ -1028,14 +1019,21 @@ void primeConnection() throws IOException {
                             } else if (childWatchesIter.hasNext()) {
                                 watch = childWatchesIter.next();
                                 childWatchesBatch.add(watch);
+                            }  else if (persistentWatchesIter.hasNext()) {
+                                watch = persistentWatchesIter.next();
+                                persistentWatchesBatch.add(watch);
+                            } else if 
(persistentRecursiveWatchesIter.hasNext()) {
+                                watch = persistentRecursiveWatchesIter.next();
+                                persistentRecursiveWatchesBatch.add(watch);
                             } else {
                                 break;
                             }
                             batchLength += watch.length();
                         }
 
-                        SetWatches sw = new SetWatches(setWatchesLastZxid, 
dataWatchesBatch, existWatchesBatch, childWatchesBatch);
-                        RequestHeader header = new RequestHeader(-8, 
OpCode.setWatches);
+                        SetWatches2 sw = new SetWatches2(setWatchesLastZxid, 
dataWatchesBatch, existWatchesBatch,
 
 Review comment:
   I think it is better to use the new message type when it is required, that 
is when you have at least one persistent watch

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to