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 BAADEC98F for ; Fri, 19 Jul 2013 17:11:18 +0000 (UTC) Received: (qmail 30875 invoked by uid 500); 19 Jul 2013 17:11:18 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 30829 invoked by uid 500); 19 Jul 2013 17:11:18 -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 30771 invoked by uid 99); 19 Jul 2013 17:11:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 17:11:16 +0000 X-ASF-Spam-Status: No, hits=-2000.4 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; Fri, 19 Jul 2013 17:11:08 +0000 Received: (qmail 27834 invoked by uid 99); 19 Jul 2013 17:10:48 -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, 19 Jul 2013 17:10:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 194B18AF130; Fri, 19 Jul 2013 17:10:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zarfide@apache.org To: commits@curator.incubator.apache.org Date: Fri, 19 Jul 2013 17:10:48 -0000 Message-Id: <54f955b0d242481183bde365c7f856c1@git.apache.org> In-Reply-To: <1dd334e168f94f36a61c539d5a780eeb@git.apache.org> References: <1dd334e168f94f36a61c539d5a780eeb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: updated javadoc on leaderselector to reflect fairness as opposed to randomness X-Virus-Checked: Checked by ClamAV on apache.org updated javadoc on leaderselector to reflect fairness as opposed to randomness Project: http://git-wip-us.apache.org/repos/asf/incubator-curator/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-curator/commit/c8009fb0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-curator/tree/c8009fb0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-curator/diff/c8009fb0 Branch: refs/heads/CURATOR-44 Commit: c8009fb0a4e936d0945702d609466cc191607fa9 Parents: f4a5ee6 Author: Jay Zarfoss Authored: Fri Jul 19 10:09:13 2013 -0700 Committer: Jay Zarfoss Committed: Fri Jul 19 10:09:13 2013 -0700 ---------------------------------------------------------------------- .../framework/recipes/leader/LeaderSelector.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-curator/blob/c8009fb0/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java index 5c33622..b6bb3c0 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java @@ -40,10 +40,19 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; /** - * Abstraction to select a "leader" amongst multiple contenders in a group of JMVs connected - * to a Zookeeper cluster. If a group of N thread/processes contend for leadership one will randomly - * be assigned leader until it releases leadership at which time another one from the group will randomly - * be chosen + *

+ * Abstraction select a "leader" amongst multiple contenders in a group of JMVs connected + * to a Zookeeper cluster. If a group of N thread/processes contend for leadership, one will + * be assigned leader until it releases leadership at which time another one from the group will + * be chosen. + *

+ * + *

+ * Note that this class uses an underlying {@link InterProcessMutex} and as a result leader + * election is "fair" - each user will become leader in the order originally requested + * (from ZK's point of view). + *

+ * */ public class LeaderSelector implements Closeable {