public static class QuorumPeer.QuorumServer
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
java.net.InetSocketAddress |
addr |
|
java.net.InetSocketAddress |
electionAddr |
|
int |
electionPort |
|
java.lang.String |
hostname |
|
long |
id |
|
int |
port |
|
QuorumPeer.LearnerType |
type |
Constructor | Description |
---|---|
QuorumServer(long id,
java.lang.String hostname,
java.lang.Integer port,
java.lang.Integer electionPort,
QuorumPeer.LearnerType type) |
|
QuorumServer(long id,
java.net.InetSocketAddress addr) |
Modifier and Type | Method | Description |
---|---|---|
java.net.InetAddress |
getReachableAddress(java.lang.String hostname,
int timeout) |
Resolve the hostname to IP addresses, and find one reachable address.
|
void |
recreateSocketAddresses() |
Performs a DNS lookup of hostname and (re)creates the this.addr and
this.electionAddr InetSocketAddress objects as appropriate
If the DNS lookup fails, this.addr and electionAddr remain
unmodified, unless they were never set.
|
public java.net.InetSocketAddress addr
public java.net.InetSocketAddress electionAddr
public java.lang.String hostname
public int port
public int electionPort
public long id
public QuorumPeer.LearnerType type
public QuorumServer(long id, java.net.InetSocketAddress addr)
public QuorumServer(long id, java.lang.String hostname, java.lang.Integer port, java.lang.Integer electionPort, QuorumPeer.LearnerType type)
public void recreateSocketAddresses()
public java.net.InetAddress getReachableAddress(java.lang.String hostname, int timeout) throws java.net.UnknownHostException
hostname
- the name of the hosttimeout
- the time, in milliseconds, before InetAddress.isReachable(int)
abortsjava.net.UnknownHostException
Copyright © 2018 The Apache Software Foundation