curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [2/6] curator git commit: Return old data for NODE_REMOVED
Date Mon, 18 Jan 2016 02:35:01 GMT
Return old data for NODE_REMOVED


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6b8113b6
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6b8113b6
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6b8113b6

Branch: refs/heads/master
Commit: 6b8113b65dce1958a405186ff8ee3c9b4f14f362
Parents: a01f2a0
Author: randgalt <randgalt@apache.org>
Authored: Fri Jan 15 12:23:34 2016 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Fri Jan 15 12:23:34 2016 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/recipes/cache/TreeCache.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/6b8113b6/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index eeb54a5..f2ba186 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@ -296,8 +296,8 @@ public class TreeCache implements Closeable
 
         void wasDeleted() throws Exception
         {
-            stat.set(null);
-            data.set(null);
+            Stat oldStat = stat.getAndSet(null);
+            byte[] oldData = data.getAndSet(null);
             client.clearWatcherReferences(this);
             ConcurrentMap<String, TreeNode> childMap = children.getAndSet(null);
             if ( childMap != null )
@@ -318,7 +318,7 @@ public class TreeCache implements Closeable
             NodeState oldState = nodeState.getAndSet(NodeState.DEAD);
             if ( oldState == NodeState.LIVE )
             {
-                publishEvent(TreeCacheEvent.Type.NODE_REMOVED, path);
+                publishEvent(TreeCacheEvent.Type.NODE_REMOVED, new ChildData(path, oldStat,
oldData));
             }
 
             if ( parent == null )


Mime
View raw message