Class QuorumPeer.QuorumServer
- java.lang.Object
-
- org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer
-
- Enclosing class:
- QuorumPeer
public static class QuorumPeer.QuorumServer extends Object
-
-
Field Summary
Fields Modifier and Type Field Description MultipleAddresses
addr
InetSocketAddress
clientAddr
MultipleAddresses
electionAddr
String
hostname
long
id
boolean
isClientAddrFromStatic
QuorumPeer.LearnerType
type
-
Constructor Summary
Constructors Constructor Description QuorumServer(long sid, String addressStr)
QuorumServer(long id, InetSocketAddress addr)
QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr)
QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr)
QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr, QuorumPeer.LearnerType type)
QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, QuorumPeer.LearnerType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAddressDuplicate(QuorumPeer.QuorumServer s)
static String
delimitedHostString(InetSocketAddress addr)
boolean
equals(Object o)
long
getId()
int
hashCode()
void
recreateSocketAddresses()
Performs a DNS lookup for server address and election address.String
toString()
-
-
-
Field Detail
-
addr
public MultipleAddresses addr
-
electionAddr
public MultipleAddresses electionAddr
-
clientAddr
public InetSocketAddress clientAddr
-
id
public long id
-
hostname
public String hostname
-
type
public QuorumPeer.LearnerType type
-
isClientAddrFromStatic
public boolean isClientAddrFromStatic
-
-
Constructor Detail
-
QuorumServer
public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr)
-
QuorumServer
public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr)
-
QuorumServer
public QuorumServer(long id, InetSocketAddress addr)
-
QuorumServer
public QuorumServer(long sid, String addressStr) throws QuorumPeerConfig.ConfigException
- Throws:
QuorumPeerConfig.ConfigException
-
QuorumServer
public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, QuorumPeer.LearnerType type)
-
QuorumServer
public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr, QuorumPeer.LearnerType type)
-
-
Method Detail
-
getId
public long getId()
-
recreateSocketAddresses
public void recreateSocketAddresses()
Performs a DNS lookup for server address and election address. If the DNS lookup fails, this.addr and electionAddr remain unmodified.
-
delimitedHostString
public static String delimitedHostString(InetSocketAddress addr)
-
checkAddressDuplicate
public void checkAddressDuplicate(QuorumPeer.QuorumServer s) throws KeeperException.BadArgumentsException
-
-