You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2016/01/18 22:04:06 UTC
[03/11] curator git commit: Return old data for NODE_REMOVED
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/CURATOR-3.0
Commit: 6b8113b65dce1958a405186ff8ee3c9b4f14f362
Parents: a01f2a0
Author: randgalt <ra...@apache.org>
Authored: Fri Jan 15 12:23:34 2016 -0500
Committer: randgalt <ra...@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 )