public class ObserverMaster extends LearnerMaster implements Runnable
Modifier and Type | Method and Description |
---|---|
void |
addLearnerHandler(LearnerHandler learnerHandler)
start tracking a learner handler
|
Iterable<Map<String,Object>> |
getActiveObservers() |
long |
getAndDecrementFollowerCounter()
decrement follower count
|
int |
getCurrentTick()
the current tick
|
long |
getEpochToPropose(long sid,
long lastAcceptedEpoch)
get the first zxid of the next epoch
|
long |
getLastProposed()
last proposed zxid
|
String |
getPeerInfo(long sid) |
QuorumAuthServer |
getQuorumAuthServer() |
byte[] |
getQuorumVerifierBytes()
identifier of current quorum verifier for new leader
|
long |
getQuorumVerifierVersion()
version of current quorum verifier
|
int |
getTickOfInitialAckDeadline()
next deadline tick marking observer sync (steady state)
|
int |
getTickOfNextAckDeadline()
deadline tick marking observer sync (initial)
|
ZKDatabase |
getZKDatabase()
ZKDatabase
|
void |
processAck(long sid,
long zxid,
SocketAddress localSocketAddress)
handle ack packet
|
void |
registerLearnerHandlerBean(LearnerHandler learnerHandler,
Socket socket)
registers the handler's bean
|
void |
removeLearnerHandler(LearnerHandler learnerHandler)
stop tracking a learner handler
|
void |
resetObserverConnectionStats() |
void |
revalidateSession(QuorumPacket qp,
LearnerHandler learnerHandler)
handle revalidate packet
|
void |
run() |
void |
start() |
long |
startForwarding(LearnerHandler learnerHandler,
long lastSeenZxid)
begin forwarding packets to learner handler
|
void |
stop() |
void |
submitLearnerRequest(Request si)
proxy request from learner to server
|
int |
syncTimeout()
time allowed for sync response
|
void |
touch(long sess,
int to)
mark session as alive
|
void |
unregisterLearnerHandlerBean(LearnerHandler learnerHandler)
unregisters the handler's bean
|
void |
waitForEpochAck(long sid,
StateSummary ss)
wait for the leader of the new epoch to be confirmed by followers
|
void |
waitForNewLeaderAck(long sid,
long zxid)
wait for new leader to settle
|
void |
waitForStartup()
wait for server to start
|
getLearnerDiffSyncThrottler, getLearnerSnapSyncThrottler, getMaxConcurrentDiffSyncs, getMaxConcurrentSnapSyncs, setMaxConcurrentDiffSyncs, setMaxConcurrentSnapSyncs
public void addLearnerHandler(LearnerHandler learnerHandler)
LearnerMaster
learnerHandler
- to trackpublic void removeLearnerHandler(LearnerHandler learnerHandler)
LearnerMaster
learnerHandler
- to droppublic int syncTimeout()
LearnerMaster
public int getTickOfNextAckDeadline()
LearnerMaster
public int getTickOfInitialAckDeadline()
LearnerMaster
public long getAndDecrementFollowerCounter()
LearnerMaster
public void waitForEpochAck(long sid, StateSummary ss) throws IOException, InterruptedException
LearnerMaster
sid
- learner idIOException
InterruptedException
public void waitForStartup() throws InterruptedException
LearnerMaster
InterruptedException
public long getLastProposed()
LearnerMaster
public long getEpochToPropose(long sid, long lastAcceptedEpoch) throws InterruptedException, IOException
LearnerMaster
sid
- learner idInterruptedException
IOException
public ZKDatabase getZKDatabase()
LearnerMaster
public void waitForNewLeaderAck(long sid, long zxid) throws InterruptedException
LearnerMaster
sid
- id of learnerzxid
- zxid at learnerInterruptedException
public int getCurrentTick()
LearnerMaster
public void processAck(long sid, long zxid, SocketAddress localSocketAddress)
LearnerMaster
sid
- leader idzxid
- packet zxidlocalSocketAddress
- forwarder's addresspublic void touch(long sess, int to)
LearnerMaster
sess
- session idto
- timeoutpublic void revalidateSession(QuorumPacket qp, LearnerHandler learnerHandler) throws IOException
LearnerMaster
qp
- session packetlearnerHandler
- learnerIOException
public void submitLearnerRequest(Request si)
LearnerMaster
si
- requestpublic long startForwarding(LearnerHandler learnerHandler, long lastSeenZxid)
LearnerMaster
learnerHandler
- learnerlastSeenZxid
- zxid of learnerpublic long getQuorumVerifierVersion()
LearnerMaster
public String getPeerInfo(long sid)
sid
- server idpublic byte[] getQuorumVerifierBytes()
LearnerMaster
public QuorumAuthServer getQuorumAuthServer()
public void start() throws IOException
IOException
public void stop()
public void resetObserverConnectionStats()
public void registerLearnerHandlerBean(LearnerHandler learnerHandler, Socket socket)
LearnerMaster
learnerHandler
- handlersocket
- connection to learnerpublic void unregisterLearnerHandlerBean(LearnerHandler learnerHandler)
LearnerMaster
learnerHandler
- handlerCopyright © 2008–2021 The Apache Software Foundation. All rights reserved.