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 3CD2810DA9 for ; Mon, 10 Jun 2013 15:51:09 +0000 (UTC) Received: (qmail 40474 invoked by uid 500); 10 Jun 2013 15:51:08 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 40419 invoked by uid 500); 10 Jun 2013 15:51:08 -0000 Mailing-List: contact commits-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.incubator.apache.org Delivered-To: mailing list commits@curator.incubator.apache.org Received: (qmail 40403 invoked by uid 99); 10 Jun 2013 15:51:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 15:51:07 +0000 X-ASF-Spam-Status: No, hits=-2000.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 10 Jun 2013 15:51:06 +0000 Received: (qmail 40284 invoked by uid 99); 10 Jun 2013 15:50:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 15:50:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2CDBC8A294E; Mon, 10 Jun 2013 15:50:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.incubator.apache.org Date: Mon, 10 Jun 2013 15:50:49 -0000 Message-Id: <7ce4d717719b48e2998315470107ccb0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/5] git commit: Added doc X-Virus-Checked: Checked by ClamAV on apache.org Added doc Project: http://git-wip-us.apache.org/repos/asf/incubator-curator/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-curator/commit/53fd8571 Tree: http://git-wip-us.apache.org/repos/asf/incubator-curator/tree/53fd8571 Diff: http://git-wip-us.apache.org/repos/asf/incubator-curator/diff/53fd8571 Branch: refs/heads/CURATOR-25 Commit: 53fd85714d3d6070bc1febb4ce1c318de72755b2 Parents: f074683 Author: randgalt Authored: Mon Jun 10 08:50:26 2013 -0700 Committer: randgalt Committed: Mon Jun 10 08:50:26 2013 -0700 ---------------------------------------------------------------------- .../src/site/confluence/index.confluence | 17 +++++---- .../persistent-ephemeral-node.confluence | 37 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-curator/blob/53fd8571/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 b5c5435..c37b0de 100644 --- a/curator-recipes/src/site/confluence/index.confluence +++ b/curator-recipes/src/site/confluence/index.confluence @@ -13,13 +13,6 @@ Curator implements all of the recipes listed on the ZooKeeper recipes doc (excep |[[Shared Semaphore|shared-semaphore.html]] - A counting semaphore that works across JVMs. All processes in all JVMs that use the same lock path will achieve an inter-process limited set of leases. Further, this semaphore is mostly "fair" - each user will get a lease in the order requested (from ZK's point of view).| |[[Multi Shared Lock|multi-shared-lock.html]] - A container that manages multiple locks as a single entity. When acquire() is called, all the locks are acquired. If that fails, any paths that were acquired are released. Similarly, when release() is called, all locks are released (failures are ignored).| -||Queues|| -|[[Distributed Queue|distributed-queue.html]] - An implementation of the Distributed Queue ZK recipe. Items put into the queue are guaranteed to be ordered (by means of ZK's PERSISTENT_SEQUENTIAL node). If a single consumer takes items out of the queue, they will be ordered FIFO. If ordering is important, use a LeaderSelector to nominate a single consumer.| -|[[Distributed Id Queue|distributed-id-queue.html]] - A version of DistributedQueue that allows IDs to be associated with queue items. Items can then be removed from the queue if needed.| -|[[Distributed Priority Queue|distributed-priority-queue.html]] - An implementation of the Distributed Priority Queue ZK recipe.| -|[[Distributed Delay Queue|distributed-delay-queue.html]] - An implementation of a Distributed Delay Queue.| -|[[Simple Distributed Queue|simple-distributed-queue.html]] - A drop-in replacement for the DistributedQueue that comes with the ZK distribution.| - ||Barriers|| |[[Barrier|barrier.html]] - Distributed systems use barriers to block processing of a set of nodes until a condition is met at which time all the nodes are allowed to proceed.| |[[Double Barrier|double-barrier.html]] - Double barriers enable clients to synchronize the beginning and the end of a computation. When enough processes have joined the barrier, processes start their computation and leave the barrier once they have finished.| @@ -31,3 +24,13 @@ 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.| + +||Nodes|| +|[[Persistent Ephemeral Node|persistent-ephemeral-node.html]] - An ephemeral node that attempts to stay present in ZooKeeper, even through connection and session interruptions..| + +||Queues|| +|[[Distributed Queue|distributed-queue.html]] - An implementation of the Distributed Queue ZK recipe. Items put into the queue are guaranteed to be ordered (by means of ZK's PERSISTENT_SEQUENTIAL node). If a single consumer takes items out of the queue, they will be ordered FIFO. If ordering is important, use a LeaderSelector to nominate a single consumer.| +|[[Distributed Id Queue|distributed-id-queue.html]] - A version of DistributedQueue that allows IDs to be associated with queue items. Items can then be removed from the queue if needed.| +|[[Distributed Priority Queue|distributed-priority-queue.html]] - An implementation of the Distributed Priority Queue ZK recipe.| +|[[Distributed Delay Queue|distributed-delay-queue.html]] - An implementation of a Distributed Delay Queue.| +|[[Simple Distributed Queue|simple-distributed-queue.html]] - A drop-in replacement for the DistributedQueue that comes with the ZK distribution.| http://git-wip-us.apache.org/repos/asf/incubator-curator/blob/53fd8571/curator-recipes/src/site/confluence/persistent-ephemeral-node.confluence ---------------------------------------------------------------------- diff --git a/curator-recipes/src/site/confluence/persistent-ephemeral-node.confluence b/curator-recipes/src/site/confluence/persistent-ephemeral-node.confluence new file mode 100644 index 0000000..0023f57 --- /dev/null +++ b/curator-recipes/src/site/confluence/persistent-ephemeral-node.confluence @@ -0,0 +1,37 @@ +h1. Persistent Ephemeral Node + +h2. Description +A persistent ephemeral node is an ephemeral node that attempts to stay present in ZooKeeper, even through connection and session interruptions. + +h2. Participating Classes +* PersistentEphemeralNode + +h2. Usage +h3. Creating a PersistentEphemeralNode +{code} +public PersistentEphemeralNode(CuratorFramework client, + PersistentEphemeralNode.Mode mode, + String basePath, + byte[] data) +Parameters: +client - client instance +mode - creation/protection mode +basePath - the base path for the node +data - data for the node +{code} + +h3. General Usage +PersistentEphemeralNodes must be started: +{code} +node.start(); +{code} + +When you are through with the PersistentEphemeralNode instance, you should call close: +{code} +node.close(); +{code} + +NOTE: this will delete the node + +h2. Error Handling +PersistentEphemeralNode instances internally handle all error states recreating the node as necessary.