|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode
public class NetworkNode
This class represents a networked element in the system. The class also contains the definitions for the helper classes in the network simulation that together are responsible to introduce and simulate network delays in the system. The instances of this class are always present and represent the general network capabilities in the hosts.
Nested Class Summary | |
---|---|
static class |
NetworkNode.NetworkException
|
(package private) static class |
NetworkNode.SingleTransfer
The instances of this class represent an individual data transfer in the system. |
Field Summary | |
---|---|
MaxMinConsumer |
diskinbws
Models the write bandwidth of the disk of this network node |
MaxMinProvider |
diskoutbws
Models the read bandwidth of the disk of this network node |
MaxMinConsumer |
inbws
Models the incoming network connections of this network node |
private Map<String,Integer> |
latencies
The direct network connections of this network node. |
MaxMinConsumer |
meminbws
Models the memory write bandwidth on this network node |
MaxMinProvider |
memoutbws
Models the memory read bandwidth on this network node |
private String |
name
The name of this network node (this could be an IP or what is most suitable for the simulation at hand). |
MaxMinProvider |
outbws
Models the outgoing network connections of this network node |
Constructor Summary | |
---|---|
NetworkNode(String id,
long maxInBW,
long maxOutBW,
long diskBW,
Map<String,Integer> latencymap)
This function initializes the bandwidth spreaders for the node to ensure equal network share for each transfer occurring on the node. |
Method Summary | |
---|---|
static int |
checkConnectivity(NetworkNode from,
NetworkNode to)
Determines if there is direct network connection possible between two network nodes |
long |
getDiskbw()
The bandwidth available when duplicating local disk contents. |
long |
getInputbw()
Determines the total input bandwidth available for the node |
String |
getName()
Allows to query the networknode's name |
long |
getOutputbw()
Determines the total output bandwidth available for the node |
static ResourceConsumption |
initTransfer(long size,
double limit,
NetworkNode from,
NetworkNode to,
ResourceConsumption.ConsumptionEvent e)
This function ensures the proper initialization of an individual transfer. |
ResourceConsumption |
pushFromMemory(long size,
double limit,
boolean toDisk,
ResourceConsumption.ConsumptionEvent e)
This function allows the simplified creation of singletransfer objects for modeling the operation of writing data to the disk/network of this node from its memory. |
ResourceConsumption |
readToMemory(long size,
double limit,
boolean fromDisk,
ResourceConsumption.ConsumptionEvent e)
This function allows the simplified creation of singletransfer objects for modeling the operation of reading data from the disk/network of this node to its memory. |
String |
toString()
provides an overview of the network node concentrating on the network's properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final MaxMinConsumer inbws
public final MaxMinProvider outbws
public final MaxMinConsumer diskinbws
public final MaxMinProvider diskoutbws
public final MaxMinConsumer meminbws
public final MaxMinProvider memoutbws
private final String name
private final Map<String,Integer> latencies
Constructor Detail |
---|
public NetworkNode(String id, long maxInBW, long maxOutBW, long diskBW, Map<String,Integer> latencymap)
maxInBW
- the input bw of the nodemaxOutBW
- the output bw of the nodediskBW
- the disk bw of the nodeMethod Detail |
---|
public long getOutputbw()
public long getInputbw()
public long getDiskbw()
public static ResourceConsumption initTransfer(long size, double limit, NetworkNode from, NetworkNode to, ResourceConsumption.ConsumptionEvent e) throws NetworkNode.NetworkException
size
- defines the size of the transfer to be simulatedfrom
- defines the source of the transferto
- defines the destination of the transfere
- defines the way the initiator will be notified upon the
completion of the transfer
NetworkNode.NetworkException
public ResourceConsumption pushFromMemory(long size, double limit, boolean toDisk, ResourceConsumption.ConsumptionEvent e)
size
- the amount of data to be transferred from the memory to the
disk/network (in bytes)limit
- the maximum bandwidth allowed to be available for this
particular transfer (in bytes/tick)toDisk
- e
- to be fired when the transfer completes
public ResourceConsumption readToMemory(long size, double limit, boolean fromDisk, ResourceConsumption.ConsumptionEvent e)
size
- the amount of data to be transferred to the memory from the
disk/network (in bytes)limit
- the maximum bandwidth allowed to be available for this
particular transfer (in bytes/tick)fromDisk
- e
- to be fired when the transfer completes
public static int checkConnectivity(NetworkNode from, NetworkNode to) throws NetworkNode.NetworkException
from
- the network node which is expected to send some datato
- the network node which is expected to receive the sent data
NetworkNode.NetworkException
- if there is no direct connection possible between the two
specified nodes.public String getName()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |