public class Observer extends Learner
Modifier and Type | Field and Description |
---|---|
static String |
OBSERVER_ELECTION_DELAY_MS
Delay the Observer's participation in a leader election upon disconnect
so as to prevent unexpected additional load on the voting peers during
the process.
|
static String |
OBSERVER_RECONNECT_DELAY_MS
When observer lost its connection with the leader, it waits for 0 to the
specified value before trying to reconnect with the leader.
|
bufferedOutput, leaderAddr, leaderIs, leaderOs, leaderProtocolVersion, messageTracker, sock
Modifier and Type | Method and Description |
---|---|
QuorumPeer.QuorumServer |
getCurrentLearnerMaster() |
long |
getLearnerMasterId() |
static long |
getObserverElectionDelayMs() |
protected void |
processPacket(QuorumPacket qp)
Controls the response of an observer to the receipt of a quorumpacket
|
boolean |
setLearnerMaster(String learnerMaster)
Prompts the Observer to disconnect from its current learner master and reconnect
to the specified server.
|
static void |
setObserverElectionDelayMs(long electionDelayMs) |
void |
shutdown()
Shutdown the Observer.
|
String |
toString() |
connectToLeader, createSocket, findLeader, getPendingRevalidationsCount, getSocket, nanoTime, ping, registerWithLeader, revalidate, sockConnect, syncWithLeader
public static final String OBSERVER_RECONNECT_DELAY_MS
public static final String OBSERVER_ELECTION_DELAY_MS
protected void processPacket(QuorumPacket qp) throws Exception
qp
- Exception
public long getLearnerMasterId()
public boolean setLearnerMaster(String learnerMaster)
public QuorumPeer.QuorumServer getCurrentLearnerMaster()
public static long getObserverElectionDelayMs()
public static void setObserverElectionDelayMs(long electionDelayMs)
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.