public class QuorumMaj extends Object implements QuorumVerifier
Constructor and Description |
---|
QuorumMaj(Map<Long,QuorumPeer.QuorumServer> allMembers)
Defines a majority to avoid computing it every time.
|
QuorumMaj(Properties props) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsQuorum(Set<Long> ackSet)
Verifies if a set is a majority.
|
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 weight of 1 by default.
|
int |
hashCode() |
void |
setVersion(long ver) |
String |
toString() |
public QuorumMaj(Map<Long,QuorumPeer.QuorumServer> allMembers)
public QuorumMaj(Properties props) 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 String toString()
toString
in interface QuorumVerifier
toString
in class Object
public boolean containsQuorum(Set<Long> ackSet)
containsQuorum
in interface QuorumVerifier
public Map<Long,QuorumPeer.QuorumServer> getAllMembers()
getAllMembers
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–2021 The Apache Software Foundation. All rights reserved.