org.apache.zookeeper.server.quorum
Class LearnerHandler
java.lang.Object
java.lang.Thread
org.apache.zookeeper.server.quorum.LearnerHandler
- All Implemented Interfaces:
- Runnable
public class LearnerHandler
- extends Thread
There will be an instance of this class created by the Leader for each
learner. All communication with a learner is handled by this
class.
Field Summary |
protected long |
sid
ZooKeeper server identifier of this learner |
protected Socket |
sock
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
sock
protected final Socket sock
sid
protected long sid
- ZooKeeper server identifier of this learner
getSocket
public Socket getSocket()
toString
public String toString()
- Overrides:
toString
in class Thread
getLearnerType
public QuorumPeer.LearnerType getLearnerType()
packetToString
public static String packetToString(QuorumPacket p)
run
public void run()
- This thread will receive packets from the peer and process them and
also listen to new connections from new peers.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
shutdown
public void shutdown()
tickOfLastAck
public long tickOfLastAck()
ping
public void ping()
- ping calls from the leader to the peers
synced
public boolean synced()
Copyright © 2012 The Apache Software Foundation