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 2013/06/10 17:50:48 UTC

[3/5] git commit: Added doc

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/2.0.2-incubating
Commit: 53fd85714d3d6070bc1febb4ce1c318de72755b2
Parents: f074683
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 10 08:50:26 2013 -0700
Committer: randgalt <ra...@apache.org>
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.