Return-Path: Delivered-To: apmail-hadoop-zookeeper-commits-archive@minotaur.apache.org Received: (qmail 62727 invoked from network); 5 May 2010 22:42:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 May 2010 22:42:09 -0000 Received: (qmail 11796 invoked by uid 500); 5 May 2010 22:42:09 -0000 Delivered-To: apmail-hadoop-zookeeper-commits-archive@hadoop.apache.org Received: (qmail 11762 invoked by uid 500); 5 May 2010 22:42:09 -0000 Mailing-List: contact zookeeper-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-dev@ Delivered-To: mailing list zookeeper-commits@hadoop.apache.org Received: (qmail 11753 invoked by uid 99); 5 May 2010 22:42:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 22:42:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 22:42:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1802323888FE; Wed, 5 May 2010 22:41:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r941521 - in /hadoop/zookeeper/trunk: CHANGES.txt docs/recipes.html docs/recipes.pdf src/docs/src/documentation/content/xdocs/recipes.xml Date: Wed, 05 May 2010 22:41:15 -0000 To: zookeeper-commits@hadoop.apache.org From: mahadev@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100505224115.1802323888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mahadev Date: Wed May 5 22:41:14 2010 New Revision: 941521 URL: http://svn.apache.org/viewvc?rev=941521&view=rev Log: ZOOKEEPER-766. forrest recipes docs don't mention the lock/queue recipe implementations available in the release (phunt via mahadev) Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/docs/recipes.html hadoop/zookeeper/trunk/docs/recipes.pdf hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/recipes.xml Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=941521&r1=941520&r2=941521&view=diff ============================================================================== --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Wed May 5 22:41:14 2010 @@ -56,6 +56,9 @@ IMPROVEMENTS: ZOOKEEPER-724. Improve junit test integration - log harness information (phunt via mahadev) + ZOOKEEPER-766. forrest recipes docs don't mention the lock/queue recipe + implementations available in the release (phunt via mahadev) + NEW FEATURES: ZOOKEEPER-729. Java client API to recursively delete a subtree. (Kay Kay via henry) Modified: hadoop/zookeeper/trunk/docs/recipes.html URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/docs/recipes.html?rev=941521&r1=941520&r2=941521&view=diff ============================================================================== --- hadoop/zookeeper/trunk/docs/recipes.html (original) +++ hadoop/zookeeper/trunk/docs/recipes.html Wed May 5 22:41:14 2010 @@ -517,7 +517,18 @@ document.write("Last Published: " + docu the list obtained from the first getChildren( ) call. If there are are no children in the queue node, the reader waits for a watch notification to check the queue again.

- +
+
Note
+
+ +

There now exists a Queue implementation in ZooKeeper + recipes directory. This is distributed with the release -- + src/recipes/queue directory of the release artifact. +

+ +
+
+

Priority Queues

To implement a priority queue, you need only make two simple changes to the generic queue @@ -527,12 +538,23 @@ document.write("Last Published: " + docu from the queue, a client uses an up-to-date children list meaning that the client will invalidate previously obtained children lists if a watch notification triggers for the queue node.

- +

Locks

Fully distributed locks that are globally synchronous, meaning at any snapshot in time no two clients think they hold the same lock. These can be implemented using ZooKeeeper. As with priority queues, first define a lock node.

+
+
Note
+
+ +

There now exists a Lock implementation in ZooKeeper + recipes directory. This is distributed with the release -- + src/recipes/lock directory of the release artifact. +

+ +
+

Clients wishing to obtain a lock do the following:

    @@ -615,7 +637,7 @@ document.write("Last Published: " + docu - +

    Shared Locks

    You can implement shared locks by with a few changes to the lock protocol:

    @@ -777,7 +799,7 @@ document.write("Last Published: " + docu - +

    Recoverable Shared Locks

    With minor modifications to the Shared Lock protocol, you make shared locks revocable by modifying the shared lock protocol:

    @@ -799,7 +821,7 @@ document.write("Last Published: " + docu Laser Beams by stipulating in your protocol that the revoker is allowed to delete the lock node if after some length of time the lock isn't deleted by the lock holder.

    - +

    Two-phased Commit

    A two-phase commit protocol is an algorithm that lets all clients in a distributed system agree either to commit a transaction or abort.

    @@ -831,7 +853,7 @@ document.write("Last Published: " + docu

    To address the second problem, you can have the coordinator propagate the transaction to the sites, and have each site creating its own ephemeral node.

    - +

    Leader Election

    A simple way of doing leader election with ZooKeeper is to use the SEQUENCE|EPHEMERAL flags when creating Modified: hadoop/zookeeper/trunk/docs/recipes.pdf URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/docs/recipes.pdf?rev=941521&r1=941520&r2=941521&view=diff ============================================================================== Binary files - no diff available. Modified: hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/recipes.xml URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/recipes.xml?rev=941521&r1=941520&r2=941521&view=diff ============================================================================== --- hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/recipes.xml (original) +++ hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/recipes.xml Wed May 5 22:41:14 2010 @@ -267,6 +267,13 @@ ) call. If there are are no children in the queue node, the reader waits for a watch notification to check the queue again. + + There now exists a Queue implementation in ZooKeeper + recipes directory. This is distributed with the release -- + src/recipes/queue directory of the release artifact. + + +

    Priority Queues @@ -289,6 +296,13 @@ can be implemented using ZooKeeeper. As with priority queues, first define a lock node. + + There now exists a Lock implementation in ZooKeeper + recipes directory. This is distributed with the release -- + src/recipes/lock directory of the release artifact. + + + Clients wishing to obtain a lock do the following: