|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.zookeeper.server.quorum.flexible.QuorumMaj
public class QuorumMaj
This class implements a validator for majority quorums. The implementation is straightforward.
Constructor Summary | |
---|---|
QuorumMaj(int n)
Defines a majority to avoid computing it every time. |
Method Summary | |
---|---|
boolean |
containsQuorum(HashSet<Long> set)
Verifies if a set is a majority. |
long |
getWeight(long id)
Returns weight of 1 by default. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuorumMaj(int n)
n
- number of serversMethod Detail |
---|
public long getWeight(long id)
getWeight
in interface QuorumVerifier
id
- public boolean containsQuorum(HashSet<Long> set)
containsQuorum
in interface QuorumVerifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |