public class QuorumHierarchical extends java.lang.Object implements QuorumVerifier
| Constructor and Description |
|---|
QuorumHierarchical(int numGroups,
java.util.HashMap<java.lang.Long,java.lang.Long> serverWeight,
java.util.HashMap<java.lang.Long,java.lang.Long> serverGroup)
This contructor takes the two hash maps needed to enable
validating quorums.
|
QuorumHierarchical(java.util.Properties qp)
This constructor takes a set of properties.
|
QuorumHierarchical(java.lang.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(java.util.HashSet<java.lang.Long> set)
Verifies if a given set is a quorum.
|
long |
getWeight(long id)
Returns the weight of a server.
|
public QuorumHierarchical(java.lang.String filename)
throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigExceptionpublic QuorumHierarchical(java.util.Properties qp)
throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigExceptionpublic QuorumHierarchical(int numGroups,
java.util.HashMap<java.lang.Long,java.lang.Long> serverWeight,
java.util.HashMap<java.lang.Long,java.lang.Long> serverGroup)
numGroups - serverWeight - serverGroup - public long getWeight(long id)
getWeight in interface QuorumVerifierid - public boolean containsQuorum(java.util.HashSet<java.lang.Long> set)
containsQuorum in interface QuorumVerifierCopyright © 2016 The Apache Software Foundation