public class QuorumHierarchical extends Object implements QuorumVerifier
| Constructor and Description |
|---|
QuorumHierarchical(int numGroups,
HashMap<Long,Long> serverWeight,
HashMap<Long,Long> serverGroup)
This contructor takes the two hash maps needed to enable
validating quorums.
|
QuorumHierarchical(Properties qp)
This constructor takes a set of properties.
|
QuorumHierarchical(String filename)
This contructor requires the quorum configuration
to be declared in a separate file, and it takes the
file as an input parameter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsQuorum(HashSet<Long> set)
Verifies if a given set is a quorum.
|
long |
getWeight(long id)
Returns the weight of a server.
|
public QuorumHierarchical(String filename) throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigExceptionpublic QuorumHierarchical(Properties qp) throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigExceptionpublic QuorumHierarchical(int numGroups,
HashMap<Long,Long> serverWeight,
HashMap<Long,Long> serverGroup)
numGroups - serverWeight - serverGroup - public long getWeight(long id)
getWeight in interface QuorumVerifierid - public boolean containsQuorum(HashSet<Long> set)
containsQuorum in interface QuorumVerifierCopyright © 2014 The Apache Software Foundation