hu.mta.sztaki.lpds.cloud.simulator.io
Class NetworkNode

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode
Direct Known Subclasses:
Repository

public class NetworkNode
extends Object

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.

Author:
"Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2012"

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
           
 MaxMinProvider diskoutbws
           
 MaxMinConsumer inbws
           
private  Map<String,Integer> latencies
           
 MaxMinConsumer meminbws
           
 MaxMinProvider memoutbws
           
private  String name
           
 MaxMinProvider outbws
           
 
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)
           
 long getDiskbw()
          The bandwidth available when duplicating local disk contents.
 long getInputbw()
          Determines the total input bandwidth available for the node
 String getName()
           
 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)
           
 ResourceConsumption readToMemory(long size, double limit, boolean fromDisk, ResourceConsumption.ConsumptionEvent e)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inbws

public final MaxMinConsumer inbws

outbws

public final MaxMinProvider outbws

diskinbws

public final MaxMinConsumer diskinbws

diskoutbws

public final MaxMinProvider diskoutbws

meminbws

public final MaxMinConsumer meminbws

memoutbws

public final MaxMinProvider memoutbws

name

private final String name

latencies

private final Map<String,Integer> latencies
Constructor Detail

NetworkNode

public 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.

Parameters:
maxInBW - the input bw of the node
maxOutBW - the output bw of the node
diskBW - the disk bw of the node
Method Detail

getOutputbw

public long getOutputbw()
Determines the total output bandwidth available for the node

Returns:
the maximum bandwidth with this network node can send data to the outside world

getInputbw

public long getInputbw()
Determines the total input bandwidth available for the node

Returns:
the maximum bandwidth with this network node can receive data from the outside world

getDiskbw

public long getDiskbw()
The bandwidth available when duplicating local disk contents.

Returns:
the maximal bandwidth usable by the network node while copying a file or raw disk blocks on its storage subsystem

initTransfer

public static ResourceConsumption initTransfer(long size,
                                               double limit,
                                               NetworkNode from,
                                               NetworkNode to,
                                               ResourceConsumption.ConsumptionEvent e)
                                        throws NetworkNode.NetworkException
This function ensures the proper initialization of an individual transfer.

Parameters:
size - defines the size of the transfer to be simulated
from - defines the source of the transfer
to - defines the destination of the transfer
e - defines the way the initiator will be notified upon the completion of the transfer
Throws:
NetworkNode.NetworkException

pushFromMemory

public ResourceConsumption pushFromMemory(long size,
                                          double limit,
                                          boolean toDisk,
                                          ResourceConsumption.ConsumptionEvent e)

readToMemory

public ResourceConsumption readToMemory(long size,
                                        double limit,
                                        boolean fromDisk,
                                        ResourceConsumption.ConsumptionEvent e)

checkConnectivity

public static int checkConnectivity(NetworkNode from,
                                    NetworkNode to)
                             throws NetworkNode.NetworkException
Throws:
NetworkNode.NetworkException

getName

public String getName()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.