Package org.cloudbus.cloudsim.resources
Interface FileStorage
- All Superinterfaces:
Resource
,ResourceCapacity
- All Known Implementing Classes:
HarddriveStorage
,SanStorage
public interface FileStorage extends Resource
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:
- Hard disk drive performance characteristics
-
Field Summary
Fields Modifier and Type Field Description static double
DEF_LATENCY_SECS
Default rotational latency of this storage in seconds.static int
DEF_MAX_TRANSFER_RATE_MBITS_SEC
Default maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.static double
DEF_SEEK_TIME_SECS
Default average seek time of the storage in seconds.static org.slf4j.Logger
LOGGER
static FileStorage
NULL
An attribute that implements the Null Object Design Pattern forFileStorage
objects. -
Method Summary
Modifier and Type Method Description double
getLatency()
Gets the rotational latency of this storage in seconds (if any).double
getMaxTransferRate()
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.FileStorage
setLatency(double latency)
Sets the rotational latency of this storage in seconds (if any).FileStorage
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:
- Constant Field Values
-
DEF_SEEK_TIME_SECS
static final double DEF_SEEK_TIME_SECSDefault average seek time of the storage in seconds.- See Also:
- Constant Field Values
-
DEF_MAX_TRANSFER_RATE_MBITS_SEC
static final int DEF_MAX_TRANSFER_RATE_MBITS_SECDefault maximum transfer rate of this storage system in Mega-bits/sec, i.e., the physical device reading speed.- See Also:
- Constant Field Values
-
-
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(double)
-
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
-