curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject git commit: website doc for new TreeCache
Date Fri, 08 Aug 2014 02:21:35 GMT
Repository: curator
Updated Branches:
  refs/heads/master ad6c23adc -> b052f00ba


website doc for new TreeCache


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

Branch: refs/heads/master
Commit: b052f00ba550940eb42336e13ee91e6e0a84e8cb
Parents: ad6c23a
Author: randgalt <randgalt@apache.org>
Authored: Thu Aug 7 21:21:31 2014 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Thu Aug 7 21:21:31 2014 -0500

----------------------------------------------------------------------
 .../src/site/confluence/Tree-cache.confluence   | 39 ++++++++++++++++++++
 .../src/site/confluence/index.confluence        |  1 +
 .../src/site/confluence/path-cache.confluence   |  2 +-
 3 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b052f00b/curator-recipes/src/site/confluence/Tree-cache.confluence
----------------------------------------------------------------------
diff --git a/curator-recipes/src/site/confluence/Tree-cache.confluence b/curator-recipes/src/site/confluence/Tree-cache.confluence
new file mode 100644
index 0000000..0d67857
--- /dev/null
+++ b/curator-recipes/src/site/confluence/Tree-cache.confluence
@@ -0,0 +1,39 @@
+h1. Tree Cache
+
+h2. Description
+A utility that attempts to keep all data from all children of a ZK path locally cached. This
class will watch the ZK path, respond to update/create/delete events, pull down the data,
etc. You can register a listener that will get notified when changes occur.
+
+h2. Participating Classes
+* TreeCache
+* TreeCacheListener
+* TreeCacheEvent
+* ChildData
+
+h2. Usage
+h3. Creating a TreeCache
+{code}
+public TreeCache(CuratorFramework client,
+                         String path,
+                         boolean cacheData)
+Parameters:
+client - the client
+path - path to watch
+cacheData - if true, node contents are cached in addition to the stat
+{code}
+
+h2. General Usage
+The cache must be started by calling {{start()}}. Call {{close()}} when you are through with
the cache.
+
+At any time, call {{getCurrentChildren()}} to get the current state of the cache. Alternatively,
call {{getCurrentData()}} to get
+the data for a given path that's being monitored.
+
+You can also register to be notified when a change occurs by calling {{getListenable()}}
and then:
+{code}
+public void addListener(TreeCacheListener listener)
+     Add a change listener
+Parameters:
+listener - the listener
+{code}
+
+h2. Error Handling
+TreeCache instances internally monitor a {{ConnectionStateListener}}. If the connection state
changes, the cache will receive messages detailing the change.

http://git-wip-us.apache.org/repos/asf/curator/blob/b052f00b/curator-recipes/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-recipes/src/site/confluence/index.confluence b/curator-recipes/src/site/confluence/index.confluence
index 0b00ed2..a43963c 100644
--- a/curator-recipes/src/site/confluence/index.confluence
+++ b/curator-recipes/src/site/confluence/index.confluence
@@ -24,6 +24,7 @@ Curator implements all of the recipes listed on the ZooKeeper recipes doc
(excep
 ||Caches||
 |[[Path Cache|path-cache.html]] \- A Path Cache is used to watch a ZNode. Whenever a child
is added, updated or removed, the Path Cache will change its state to contain the current
set of children, the children's data and the children's state. Path caches in the Curator
Framework are provided by the PathChildrenCache class. Changes to the path are passed to registered
PathChildrenCacheListener instances.|
 |[[Node Cache|node-cache.html]] \- A utility that attempts to keep the data from a node locally
cached. This class will watch the node, respond to update/create/delete events, pull down
the data, etc. You can register a listener that will get notified when changes occur.|
+|[[Tree Cache|tree-cache.html]] \- A utility that attempts to keep all data from all children
of a ZK path locally cached. This class will watch the ZK path, respond to update/create/delete
events, pull down the data, etc. You can register a listener that will get notified when changes
occur.|
 
 ||Nodes||
 |[[Persistent Ephemeral Node|persistent-ephemeral-node.html]] \- An ephemeral node that attempts
to stay present in ZooKeeper, even through connection and session interruptions..|

http://git-wip-us.apache.org/repos/asf/curator/blob/b052f00b/curator-recipes/src/site/confluence/path-cache.confluence
----------------------------------------------------------------------
diff --git a/curator-recipes/src/site/confluence/path-cache.confluence b/curator-recipes/src/site/confluence/path-cache.confluence
index a8f2320..1ced99d 100644
--- a/curator-recipes/src/site/confluence/path-cache.confluence
+++ b/curator-recipes/src/site/confluence/path-cache.confluence
@@ -5,7 +5,7 @@ A Path Cache is used to watch a ZNode. Whenever a child is added, updated
or rem
 
 h2. Participating Classes
 * PathChildrenCache
-* PathChildrenCacheMode
+* PathChildrenCacheEvent
 * PathChildrenCacheListener
 * ChildData
 


Mime
View raw message