Package org.cloudbus.cloudsim.resources
Interface FileStorage
- All Superinterfaces:
Resource
,ResourceCapacity
- All Known Implementing Classes:
HarddriveStorage
,SanStorage
An interface which defines the desired functionality of a storage system in a Data Cloud
that performs operations on a file system, such as file inclusion, exclusion
and renaming.
Classes that implement this interface should simulate the characteristics of different storage
systems by setting the capacity of the storage and the maximum transfer rate. The transfer rate
defines the time required to execute some common operations on the storage, e.g. storing a file,
getting a file and deleting a file.
- Author:
- Uros Cibej, Anthony Sulistio, Manoel Campos da Silva Filho
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Default rotational latency of this storage in seconds.static final int
Default maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.static final double
Default average seek time of the storage in seconds.static final org.slf4j.Logger
static final FileStorage
An attribute that implements the Null Object Design Pattern forFileStorage
objects. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the rotational latency of this storage in seconds (if any).double
Gets the maximum local transfer rate of the storage in Mega-bits/sec, i.e., the physical device reading speed.double
getTransferTime
(int fileSize) Gets the transfer time of a given file.setLatency
(double latency) Sets the rotational latency of this storage in seconds (if any).setMaxTransferRate
(double maxTransferRate) Sets the maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.Methods inherited from interface org.cloudbus.cloudsim.resources.Resource
getAllocatedResource, getAvailableResource, getPercentUtilization, getUnit, isAmountAvailable, isAmountAvailable, isAmountAvailable, isFull, isSubClassOf
Methods inherited from interface org.cloudbus.cloudsim.resources.ResourceCapacity
getCapacity
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forFileStorage
objects. -
LOGGER
static final org.slf4j.Logger LOGGER -
DEF_LATENCY_SECS
static final double DEF_LATENCY_SECSDefault rotational latency of this storage in seconds.- See Also:
-
DEF_SEEK_TIME_SECS
static final double DEF_SEEK_TIME_SECSDefault average seek time of the storage in seconds.- See Also:
-
DEF_MAX_TRANSF_RATE_MBITS_SEC
static final int DEF_MAX_TRANSF_RATE_MBITS_SECDefault maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.- See Also:
-
-
Method Details
-
getMaxTransferRate
double getMaxTransferRate()Gets the maximum local transfer rate of the storage in Mega-bits/sec, i.e., the physical device reading speed.- Returns:
- the maximum transfer rate in Mega-bits/sec
- See Also:
-
setMaxTransferRate
Sets the maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.Despite disk transfer rate is usually defined in MBytes/sec, it's being used Mbits/sec everywhere to avoid confusions, since
Host
,Vm
,Switch
andSanStorage
use such a data unit.- Parameters:
maxTransferRate
- the maximum transfer rate in Mbits/sec- Returns:
- Throws:
IllegalArgumentException
- if the value is lower than 1
-
setLatency
Sets the rotational latency of this storage in seconds (if any).- Parameters:
latency
- the new latency in seconds- Returns:
- Throws:
IllegalArgumentException
- if the value is lower than 0
-
getLatency
double getLatency()Gets the rotational latency of this storage in seconds (if any).- Returns:
- the read latency in seconds
-
getTransferTime
double getTransferTime(int fileSize) Gets the transfer time of a given file.- Parameters:
fileSize
- the size of the file to compute the transfer time (in MByte)- Returns:
- the transfer time in seconds
-