|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.client.PastryAppl
rice.pastry.standard.PeriodicLeafSetProtocol
public class PeriodicLeafSetProtocol
An implementation of a periodic-style leafset protocol
| Nested Class Summary | |
|---|---|
static class |
PeriodicLeafSetProtocol.PLSPMessageDeserializer
|
| Field Summary | |
|---|---|
int |
BLS_THROTTLE
|
protected java.util.Map |
lastTimeReceivedBLS
NodeHandle -> Long remembers the TIME when we received a BLS from that NodeHandle |
protected java.util.Map |
lastTimeSentBLS
|
protected LeafSet |
leafSet
|
int |
LEASE_PERIOD
|
protected NodeHandle |
localHandle
|
protected PastryNode |
localNode
|
int |
PING_NEIGHBOR_PERIOD
Related to rapidly determining direct neighbor liveness. |
protected RoutingTable |
routeTable
|
| Fields inherited from class rice.pastry.client.PastryAppl |
|---|
address, deserializer, instance, logger, receiver, thePastryNode |
| Constructor Summary | |
|---|---|
PeriodicLeafSetProtocol(PastryNode ln,
NodeHandle local,
LeafSet ls,
RoutingTable rt)
Builds a periodic leafset protocol |
|
| Method Summary | |
|---|---|
protected void |
broadcastAll()
Broadcast the leaf set to all members of the local leaf set. |
boolean |
deliverWhenNotReady()
We always want to receive messages. |
void |
destroy()
Called when PastryNode is destroyed. |
boolean |
hasLease(NodeHandle nh)
Do we have a lease from this node? Returns true if nh is null. |
boolean |
isReady()
|
void |
leafSetChange(NodeHandle nh,
boolean wasAdded)
Called by pastry when the leaf set changes. |
void |
messageForAppl(Message msg)
Should not be called becasue we are overriding the receiveMessage() interface anyway. |
void |
nodeSetUpdate(NodeSetEventSource nodeSetEventSource,
NodeHandle handle,
boolean added)
|
void |
receiveMessage(Message msg)
Receives messages. |
void |
removeFromLeafsetIfPossible(NodeHandle nh)
|
void |
setReady(boolean r)
|
boolean |
shouldBeReady()
|
void |
start()
Called when it is time to take over as the renderstrategy. |
void |
stop()
|
void |
update(java.util.Observable o,
java.lang.Object arg)
Only remove the item if you did not give a lease. |
| Methods inherited from class rice.pastry.client.PastryAppl |
|---|
accept, connect, enrouteMessage, getAddress, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, notifyReady, receiveMessageInternal, receiveSocket, register, routeMsg, routeMsgDirect, routeSetChange, setDeserializer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected NodeHandle localHandle
protected PastryNode localNode
protected LeafSet leafSet
protected RoutingTable routeTable
protected java.util.Map lastTimeReceivedBLS
protected java.util.Map lastTimeSentBLS
public final int PING_NEIGHBOR_PERIOD
public final int LEASE_PERIOD
public final int BLS_THROTTLE
| Constructor Detail |
|---|
public PeriodicLeafSetProtocol(PastryNode ln,
NodeHandle local,
LeafSet ls,
RoutingTable rt)
| Method Detail |
|---|
public void receiveMessage(Message msg)
receiveMessage in class PastryApplmsg - the message.protected void broadcastAll()
type - the type of broadcast message usedpublic void start()
ReadyStrategy
start in interface ReadyStrategypublic void stop()
stop in interface ReadyStrategy
public void nodeSetUpdate(NodeSetEventSource nodeSetEventSource,
NodeHandle handle,
boolean added)
nodeSetUpdate in interface NodeSetListenerpublic void setReady(boolean r)
setReady in interface ReadyStrategypublic boolean isReady()
isReady in interface ReadyStrategypublic boolean shouldBeReady()
public boolean hasLease(NodeHandle nh)
nh - the NodeHandle we are interested if we have a lease from
public void messageForAppl(Message msg)
messageForAppl in class PastryApplmsg - the message that is arriving.public boolean deliverWhenNotReady()
deliverWhenNotReady in class PastryApplpublic void destroy()
PastryAppl
destroy in class PastryAppl
public void leafSetChange(NodeHandle nh,
boolean wasAdded)
PastryAppl
leafSetChange in class PastryApplnh - the handle of the node that was added or removed.wasAdded - true if the node was added, false if the node was removed.
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observerpublic void removeFromLeafsetIfPossible(NodeHandle nh)
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||