org.apache.zookeeper.server.quorum
Class FollowerHandler

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.zookeeper.server.quorum.FollowerHandler
All Implemented Interfaces:
Runnable

public class FollowerHandler
extends Thread

There will be an instance of this class created by the Leader for each follower.All communication for a given Follower will be handled by this class.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  long sid
          ZooKeeper server identifier of this follower
 Socket sock
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static String packetToString(org.apache.zookeeper.server.quorum.QuorumPacket p)
           
 void ping()
          ping calls from the leader to the followers
 void run()
          This thread will receive packets from the follower and process them and also listen to new connections from new followers.
 void shutdown()
           
 boolean synced()
           
 long tickOfLastAck()
           
 String toString()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sock

public final Socket sock

sid

protected long sid
ZooKeeper server identifier of this follower

Method Detail

toString

public String toString()
Overrides:
toString in class Thread

packetToString

public static String packetToString(org.apache.zookeeper.server.quorum.QuorumPacket p)

run

public void run()
This thread will receive packets from the follower and process them and also listen to new connections from new followers.

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 followers


synced

public boolean synced()