PapaCharlie commented on code in PR #1950:
URL: https://github.com/apache/zookeeper/pull/1950#discussion_r1128921566


##########
zookeeper-server/src/main/java/org/apache/zookeeper/WatchedEvent.java:
##########
@@ -66,9 +78,44 @@ public String getPath() {
         return path;
     }
 
+    /**
+     * Returns the zxid of the transaction that triggered this watch if it is
+     * of one of the following types:<ul>
+     *   <li>{@link EventType#NodeCreated}</li>
+     *   <li>{@link EventType#NodeDeleted}</li>
+     *   <li>{@link EventType#NodeDataChanged}</li>
+     *   <li>{@link EventType#NodeChildrenChanged}</li>
+     * </ul>
+     * Otherwise, returns {@value #NO_ZXID}. Note that {@value #NO_ZXID} is 
also
+     * returned by old servers that do not support this feature.
+     */
+    public long getZxid() {
+        return zxid;
+    }
+
     @Override
     public String toString() {
-        return "WatchedEvent state:" + keeperState + " type:" + eventType + " 
path:" + path;
+        return "WatchedEvent state:" + keeperState + " type:" + eventType + " 
path:" + path + " zxid: " + zxid;
+    }
+
+    @Override
+    public boolean equals(Object o) {

Review Comment:
   I updated the code and left a TODO



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

To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to