org.apache.zookeeper.server.quorum.flexible
public class QuorumMaj extends Object implements QuorumVerifier
Constructor and Description |
---|
QuorumMaj(int n)
Defines a majority to avoid computing it every time.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsQuorum(HashSet<Long> set)
Verifies if a set is a majority.
|
long |
getWeight(long id)
Returns weight of 1 by default.
|
public QuorumMaj(int n)
n
- number of serverspublic long getWeight(long id)
getWeight
in interface QuorumVerifier
id
- public boolean containsQuorum(HashSet<Long> set)
containsQuorum
in interface QuorumVerifier
Copyright © 2014 The Apache Software Foundation