Class Observer
- java.lang.Object
-
- org.apache.zookeeper.server.quorum.Learner
-
- org.apache.zookeeper.server.quorum.Observer
-
public class Observer extends Learner
Observers are peers that do not take part in the atomic broadcast protocol. Instead, they are informed of successful proposals by the Leader. Observers therefore naturally act as a relay point for publishing the proposal stream and can relieve Followers of some of the connection load. Observers may submit proposals, but do not vote in their acceptance. See ZOOKEEPER-368 for a discussion of this feature.
-
-
Field Summary
-
Fields inherited from class org.apache.zookeeper.server.quorum.Learner
bufferedOutput, leaderIs, leaderOs, leaderProtocolVersion, LOG, sock
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
processPacket(QuorumPacket qp)
Controls the response of an observer to the receipt of a quorumpacketvoid
shutdown()
Shutdown the Observer.java.lang.String
toString()
-
Methods inherited from class org.apache.zookeeper.server.quorum.Learner
connectToLeader, findLeader, getPendingRevalidationsCount, getSocket, ping, registerWithLeader, revalidate, syncWithLeader
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
processPacket
protected void processPacket(QuorumPacket qp) throws java.io.IOException
Controls the response of an observer to the receipt of a quorumpacket- Parameters:
qp
-- Throws:
java.io.IOException
-
-