curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [4/8] git commit: updated javadoc on leaderselector to reflect fairness as opposed to randomness
Date Mon, 22 Jul 2013 04:44:42 GMT
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/master
Commit: c8009fb0a4e936d0945702d609466cc191607fa9
Parents: f4a5ee6
Author: Jay Zarfoss <jzarfoss@netflix.com>
Authored: Fri Jul 19 10:09:13 2013 -0700
Committer: Jay Zarfoss <jzarfoss@netflix.com>
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
+ * <p>
+ *     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.
+ * </p>
+ *
+ * <p>
+ *     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).
+ * </p>
+ *
  */
 public class LeaderSelector implements Closeable
 {


Mime
View raw message