public class QuorumHierarchical extends Object implements QuorumVerifier
Constructor and Description |
---|
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(Set<Long> set)
Verifies if a given set is a quorum.
|
boolean |
equals(Object o) |
Map<Long,QuorumPeer.QuorumServer> |
getAllMembers() |
Map<Long,QuorumPeer.QuorumServer> |
getObservingMembers() |
long |
getVersion() |
Map<Long,QuorumPeer.QuorumServer> |
getVotingMembers() |
long |
getWeight(long id)
Returns the weight of a server.
|
int |
hashCode() |
void |
setVersion(long ver) |
String |
toString() |
public QuorumHierarchical(String filename) throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigException
public QuorumHierarchical(Properties qp) throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigException
public boolean equals(Object o)
equals
in interface QuorumVerifier
equals
in class Object
public long getWeight(long id)
getWeight
in interface QuorumVerifier
id
- public Map<Long,QuorumPeer.QuorumServer> getAllMembers()
getAllMembers
in interface QuorumVerifier
public String toString()
toString
in interface QuorumVerifier
toString
in class Object
public boolean containsQuorum(Set<Long> set)
containsQuorum
in interface QuorumVerifier
public Map<Long,QuorumPeer.QuorumServer> getVotingMembers()
getVotingMembers
in interface QuorumVerifier
public Map<Long,QuorumPeer.QuorumServer> getObservingMembers()
getObservingMembers
in interface QuorumVerifier
public long getVersion()
getVersion
in interface QuorumVerifier
public void setVersion(long ver)
setVersion
in interface QuorumVerifier
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.