Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A75B111E6 for ; Fri, 8 Aug 2014 02:21:36 +0000 (UTC) Received: (qmail 92244 invoked by uid 500); 8 Aug 2014 02:21:36 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 92212 invoked by uid 500); 8 Aug 2014 02:21:36 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 92187 invoked by uid 99); 8 Aug 2014 02:21:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Aug 2014 02:21:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C80D994BB41; Fri, 8 Aug 2014 02:21:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Message-Id: <7fe0660ef7b0468c81a32527572a32ac@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: website doc for new TreeCache Date: Fri, 8 Aug 2014 02:21:35 +0000 (UTC) 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 Authored: Thu Aug 7 21:21:31 2014 -0500 Committer: randgalt 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