|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.direct.EventSimulator rice.pastry.direct.BasicNetworkSimulator<Identifier,MessageType>
public class BasicNetworkSimulator<Identifier,MessageType>
Field Summary | |
---|---|
protected int |
maxDiameter
|
protected int |
MIN_DELAY
|
protected int |
minDelay
|
Fields inherited from class org.mpisws.p2p.transport.direct.EventSimulator |
---|
environment, logger, manager, random, timeSource |
Fields inherited from interface org.mpisws.p2p.transport.liveness.LivenessTypes |
---|
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_DEAD_FOREVER, LIVENESS_SUSPECTED |
Constructor Summary | |
---|---|
BasicNetworkSimulator(Environment env,
RandomSource random,
NetworkSimulator<Identifier,MessageType> sim)
|
Method Summary | |
---|---|
void |
addLivenessListener(LivenessListener<Identifier> name)
|
boolean |
checkLiveness(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
Returns whether a new notification will occur. |
void |
clearState(Identifier i)
Force layer to clear the existing state related to the Identifier. |
Cancellable |
deliverMessage(MessageType msg,
Identifier node,
Identifier from)
node should always be a local node, because this will be delivered instantly |
Cancellable |
deliverMessage(MessageType msg,
Identifier node,
Identifier from,
int delay)
Deliver message. |
Cancellable |
deliverMessage(MessageType msg,
Identifier node,
Identifier from,
int delay,
int period)
|
Cancellable |
deliverMessageFixedRate(MessageType msg,
Identifier node,
Identifier from,
int delay,
int period)
|
CancellableTask |
enqueueDelivery(Delivery d,
int delay)
Deliver message. |
Environment |
getEnvironment()
|
Environment |
getEnvironment(Identifier i)
Get the environment related to a specific node. |
int |
getLiveness(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
|
NodeRecord |
getNodeRecord(DirectNodeHandle handle)
|
RandomSource |
getRandomSource()
|
DirectTransportLayer<Identifier,MessageType> |
getTL(Identifier i)
|
boolean |
isAlive(Identifier i)
|
float |
networkDelay(Identifier a,
Identifier b)
computes the one-way distance between two NodeIds |
float |
proximity(Identifier a,
Identifier b)
computes the rtt between two NodeIds |
void |
registerIdentifier(Identifier i,
DirectTransportLayer<Identifier,MessageType> dtl,
NodeRecord record)
set the liveliness of a NodeId |
void |
remove(Identifier i)
Kill identifier. |
boolean |
removeLivenessListener(LivenessListener<Identifier> name)
|
Methods inherited from class org.mpisws.p2p.transport.direct.EventSimulator |
---|
setFullSpeed, setMaxSpeed, simulate, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mpisws.p2p.transport.direct.GenericNetworkSimulator |
---|
setFullSpeed, setMaxSpeed, start, stop |
Field Detail |
---|
protected int MIN_DELAY
protected final int maxDiameter
protected final int minDelay
Constructor Detail |
---|
public BasicNetworkSimulator(Environment env, RandomSource random, NetworkSimulator<Identifier,MessageType> sim)
Method Detail |
---|
public CancellableTask enqueueDelivery(Delivery d, int delay)
GenericNetworkSimulator
enqueueDelivery
in interface GenericNetworkSimulator<Identifier,MessageType>
public Cancellable deliverMessage(MessageType msg, Identifier node, Identifier from)
public Cancellable deliverMessage(MessageType msg, Identifier node, Identifier from, int delay)
GenericNetworkSimulator
deliverMessage
in interface GenericNetworkSimulator<Identifier,MessageType>
msg
- message to deliver.public Cancellable deliverMessageFixedRate(MessageType msg, Identifier node, Identifier from, int delay, int period)
public Cancellable deliverMessage(MessageType msg, Identifier node, Identifier from, int delay, int period)
public void registerIdentifier(Identifier i, DirectTransportLayer<Identifier,MessageType> dtl, NodeRecord record)
nid
- the NodeId being setalive
- the value being setpublic void remove(Identifier i)
GenericNetworkSimulator
remove
in interface GenericNetworkSimulator<Identifier,MessageType>
public Environment getEnvironment()
getEnvironment
in interface GenericNetworkSimulator<Identifier,MessageType>
public Environment getEnvironment(Identifier i)
GenericNetworkSimulator
getEnvironment
in interface GenericNetworkSimulator<Identifier,MessageType>
public RandomSource getRandomSource()
getRandomSource
in interface GenericNetworkSimulator<Identifier,MessageType>
public boolean isAlive(Identifier i)
isAlive
in interface GenericNetworkSimulator<Identifier,MessageType>
public DirectTransportLayer<Identifier,MessageType> getTL(Identifier i)
getTL
in interface GenericNetworkSimulator<Identifier,MessageType>
public float networkDelay(Identifier a, Identifier b)
networkDelay
in interface GenericNetworkSimulator<Identifier,MessageType>
a
- the first NodeIdb
- the second NodeId
public float proximity(Identifier a, Identifier b)
a
- the first NodeIdb
- the second NodeId
public NodeRecord getNodeRecord(DirectNodeHandle handle)
public void addLivenessListener(LivenessListener<Identifier> name)
addLivenessListener
in interface LivenessProvider<Identifier>
public boolean removeLivenessListener(LivenessListener<Identifier> name)
removeLivenessListener
in interface LivenessProvider<Identifier>
public boolean checkLiveness(Identifier i, java.util.Map<java.lang.String,java.lang.Object> options)
LivenessProvider
checkLiveness
in interface LivenessProvider<Identifier>
i
- the node to check
public int getLiveness(Identifier i, java.util.Map<java.lang.String,java.lang.Object> options)
getLiveness
in interface LivenessProvider<Identifier>
public void clearState(Identifier i)
LivenessProvider
clearState
in interface LivenessProvider<Identifier>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |