|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.zookeeper.server.quorum.Leader
public class Leader
This class has the control logic for the Leader.
| Nested Class Summary | |
|---|---|
static class |
Leader.Proposal
|
| Field Summary | |
|---|---|
HashSet<FollowerHandler> |
followers
|
HashSet<FollowerHandler> |
forwardingFollowers
|
HashMap<Long,List<FollowerSyncRequest>> |
pendingSyncs
|
static int |
PROPOSAL
This message type is sent by a leader to propose a mutation. |
| Method Summary | |
|---|---|
void |
commit(long zxid)
Create a commit packet and send it to all the members of the quorum |
void |
processAck(long sid,
long zxid,
SocketAddress followerAddr)
Keep a count of acks that are received by the leader for a particular proposal |
void |
processSync(FollowerSyncRequest r)
Process sync requests |
Leader.Proposal |
propose(Request request)
create a proposal and send it out to all the members |
void |
sendSync(FollowerSyncRequest r)
Sends a sync message to the appropriate server |
long |
startForwarding(FollowerHandler handler,
long lastSeenZxid)
lets the leader know that a follower is capable of following and is done syncing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public HashSet<FollowerHandler> followers
public HashSet<FollowerHandler> forwardingFollowers
public HashMap<Long,List<FollowerSyncRequest>> pendingSyncs
public static final int PROPOSAL
| Method Detail |
|---|
public void processAck(long sid,
long zxid,
SocketAddress followerAddr)
zxid - the zxid of the proposal sent outfollowerAddr - public void commit(long zxid)
zxid - public Leader.Proposal propose(Request request)
request -
public void processSync(FollowerSyncRequest r)
r - the requestpublic void sendSync(FollowerSyncRequest r)
f - r -
public long startForwarding(FollowerHandler handler,
long lastSeenZxid)
handler - handler of the follower
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||