|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.client.PastryAppl rice.pastry.standard.StandardJoinProtocol rice.pastry.standard.ConsistentJoinProtocol
public class ConsistentJoinProtocol
Does not setReady until contacting entire leafset which gossips new members. Provides consistency as long as checkLiveness() never incorrectly reports a node faulty. Based on MSR-TR-2003-94. The difference is that our assumption that checkLiveness() is much stronger because we are using DSR rather than checking ourself. Another difference is that we are unwilling to pull nodes from our leafset without checkingLiveness() ourself.
Field Summary | |
---|---|
protected int |
MAX_TIME_TO_BE_SCHEDULED
This variable is set to prevent the process from going to sleep or not being scheduled for too long. |
int |
RETRY_INTERVAL
Will retry sending ConsistentJoinMsg to all neighbors who have not responded on this interval. |
protected boolean |
tryingToGoReady
Suppresses sendTheMessage() if we are not ready to do this part of the join process, or we are already done. |
Fields inherited from class rice.pastry.standard.StandardJoinProtocol |
---|
cred, leafSet, localHandle, routeTable, security |
Fields inherited from class rice.pastry.client.PastryAppl |
---|
address, instance, logger, thePastryNode |
Constructor Summary | |
---|---|
ConsistentJoinProtocol(PastryNode ln,
NodeHandle lh,
PastrySecurityManager sm,
RoutingTable rt,
LeafSet ls)
Constructor takes in the usual suspects. |
Method Summary | |
---|---|
void |
addToLeafSet(NodeHandle nh)
Observes all NodeHandles added to LeafSet |
int |
delayInterest()
Part of the LoopObserver interface. |
void |
destroy()
Called when PastryNode is destroyed. |
void |
loopTime(int loopTime)
If it took longer than the time to detect faultiness, then other nodes may believe we are faulty. |
void |
nodeSetUpdate(NodeSetEventSource set,
NodeHandle handle,
boolean added)
|
void |
otherNodesMaySuspectFaulty()
Call this if there is an event such that you may have not received messages for long enough for other nodes to call you faulty. |
void |
receiveMessage(Message msg)
Handle the CJM as in the MSR-TR |
void |
requestFromEveryoneWeHaventHeardFrom()
|
void |
sendTheMessage(NodeHandle nh,
boolean reply)
Sends a consistent join protocol message. |
protected void |
setReady()
This is where we start out, when the StandardJoinProtocol would call setReady(); |
void |
update(java.util.Observable arg0,
java.lang.Object arg)
Can be PastryNode updates, leafset updates, or nodehandle updates. |
java.util.Collection |
whoDoWeNeedAResponseFrom()
Returns all members of the leafset that are not in gotResponse |
Methods inherited from class rice.pastry.standard.StandardJoinProtocol |
---|
broadcastRows, deliverWhenNotReady, getAddress, getCredentials, messageForAppl |
Methods inherited from class rice.pastry.client.PastryAppl |
---|
enrouteMessage, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, register, registerReceiver, routeMsg, routeMsgDirect, routeSetChange, sendMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int MAX_TIME_TO_BE_SCHEDULED
protected boolean tryingToGoReady
public final int RETRY_INTERVAL
Constructor Detail |
---|
public ConsistentJoinProtocol(PastryNode ln, NodeHandle lh, PastrySecurityManager sm, RoutingTable rt, LeafSet ls)
Method Detail |
---|
protected void setReady()
setReady
in class StandardJoinProtocol
public void addToLeafSet(NodeHandle nh)
nh
- the nodeHandle to addpublic void requestFromEveryoneWeHaventHeardFrom()
public void otherNodesMaySuspectFaulty()
public java.util.Collection whoDoWeNeedAResponseFrom()
public void receiveMessage(Message msg)
receiveMessage
in interface MessageReceiver
receiveMessage
in class StandardJoinProtocol
msg
- the message that was received.public void sendTheMessage(NodeHandle nh, boolean reply)
nh
- reply
- if the reason we are sending this message is just as a responsepublic void nodeSetUpdate(NodeSetEventSource set, NodeHandle handle, boolean added)
nodeSetUpdate
in interface NodeSetListener
public void update(java.util.Observable arg0, java.lang.Object arg)
update
in interface java.util.Observer
public int delayInterest()
delayInterest
in interface LoopObserver
public void loopTime(int loopTime)
loopTime
in interface LoopObserver
loopTime
- the time it took to do a single selection loop.public void destroy()
PastryAppl
destroy
in class PastryAppl
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |