SanStorage

public class SanStorage extends HarddriveStorage

SanStorage represents a Storage Area Network (SAN) composed of a set of hard disks connected in a LAN. Capacity of individual disks are abstracted, thus only the overall capacity of the SAN is considered.

WARNING: This class is not yet fully functional. Effects of network contention are not considered in the simulation. So, time for file transfer is underestimated in the presence of high network load.

Author:Rodrigo N. Calheiros, Manoel Campos da Silva Filho

Constructors

SanStorage

public SanStorage(long capacity, double bandwidth, double networkLatency)

Creates a new SAN with a given capacity, latency, and bandwidth of the network connection.

Parameters:
  • capacity – Total storage capacity of the SAN
  • bandwidth – Network bandwidth (in Megabits/s)
  • networkLatency – Network latency (in seconds)
Throws:
  • IllegalArgumentException – when the name and the capacity are not valid

SanStorage

public SanStorage(String name, long capacity, double bandwidth, double networkLatency)

Creates a new SAN with a given capacity, latency, and bandwidth of the network connection and with a specific name.

Parameters:
  • name – the name of the new storage device
  • capacity – Storage device capacity
  • bandwidth – Network bandwidth (in Megabits/s)
  • networkLatency – Network latency (in seconds)
Throws:
  • IllegalArgumentException – when the name and the capacity are not valid

Methods

addFile

public double addFile(File file)

addReservedFile

public double addReservedFile(File file)

deleteFile

public double deleteFile(File file)

getBandwidth

public double getBandwidth()

Gets the bandwidth of the SAN network (in Megabits/s).

Returns:the bandwidth (in Megabits/s)

getNetworkLatency

public double getNetworkLatency()

Gets the SAN’s network latency (in seconds).

Returns:the SAN’s network latency (in seconds)

getTransferTime

public double getTransferTime(int fileSize)

{@inheritDoc} The network latency is added to the transfer time.

Parameters:
Returns:

{@inheritDoc}

setBandwidth

public final void setBandwidth(double bandwidth)

Sets the bandwidth of the SAN network (in Megabits/s).

Parameters:
  • bandwidth – the bandwidth to set (in Megabits/s)
Throws:

setNetworkLatency

public final void setNetworkLatency(double networkLatency)

Sets the latency of the SAN network (in seconds).

Parameters:
  • networkLatency – the latency to set (in seconds)
Throws:

toString

public String toString()