brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [1/3] git commit: Add javadoc to QuorumCheck
Date Tue, 09 Sep 2014 10:17:24 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 9283ab0c2 -> 8e505a50e


Add javadoc to QuorumCheck

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/eec69f3e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/eec69f3e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/eec69f3e

Branch: refs/heads/master
Commit: eec69f3e44084bb5348ab5950b63a344e58bf895
Parents: 954b397
Author: Aled Sage <aled.sage@gmail.com>
Authored: Fri Sep 5 16:09:01 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Fri Sep 5 16:09:01 2014 +0100

----------------------------------------------------------------------
 .../java/brooklyn/entity/basic/QuorumCheck.java | 28 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/eec69f3e/core/src/main/java/brooklyn/entity/basic/QuorumCheck.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/QuorumCheck.java b/core/src/main/java/brooklyn/entity/basic/QuorumCheck.java
index 5235413..1c07e95 100644
--- a/core/src/main/java/brooklyn/entity/basic/QuorumCheck.java
+++ b/core/src/main/java/brooklyn/entity/basic/QuorumCheck.java
@@ -20,25 +20,49 @@ package brooklyn.entity.basic;
 
 import java.io.Serializable;
 
+/**
+ * For checking if a group/cluster is quorate. That is, whether the group has sufficient
+ * healthy members.
+ */
 public interface QuorumCheck {
 
+    /**
+     * @param sizeHealthy Number of healthy members
+     * @param totalSize   Total number of members one would expect to be healthy (i.e. ignoring
stopped members)
+     * @return            Whether this group is healthy
+     */
     public boolean isQuorate(int sizeHealthy, int totalSize);
 
     public static class QuorumChecks {
+        /**
+         * Checks that all members that should be up are up (i.e. ignores stopped nodes).
+         */
         public static QuorumCheck all() {
             return new NumericQuorumCheck(0, 1.0, false);
         }
+        /**
+         * Checks all members that should be up are up, and that there is at least one such
member.
+         */
         public static QuorumCheck allAndAtLeastOne() {
             return new NumericQuorumCheck(1, 1.0, false);
         }
+        /**
+         * Requires at least one member that should be up is up.
+         */
         public static QuorumCheck atLeastOne() {
             return new NumericQuorumCheck(1, 0.0, false);
         }
-        /** require at least one to be up if the total size is non-zero;
-         * ie okay if empty, or if non-empty and something is healthy, but not okay if not-empty
and nothing is healthy */
+        /**
+         * Requires at least one member to be up if the total size is non-zero.
+         * i.e. okay if empty, or if non-empty and something is healthy, but not okay if
not-empty and nothing is healthy.
+         * "Empty" means that no members are supposed to be up  (e.g. there may be stopped
members).
+         */
         public static QuorumCheck atLeastOneUnlessEmpty() {
             return new NumericQuorumCheck(1, 0.0, true);
         }
+        /**
+         * Always "healthy"
+         */
         public static QuorumCheck alwaysTrue() {
             return new NumericQuorumCheck(0, 0.0, true);
         }


Mime
View raw message