Package org.cloudbus.cloudsim.resources
Class DatacenterStorage
java.lang.Object
org.cloudbus.cloudsim.resources.DatacenterStorage
public class DatacenterStorage extends Object
Implements the storage logic for a Datacenter. It keeps a list of
storage devices (Disk Array),
as well as all basic storage related operations.
This disk array can be, for instance, a list of
HarddriveStorage
or SanStorage
.- Since:
- CloudSim Plus 2.3.5
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Abderrahman Lahiaouni
-
Constructor Summary
Constructors Constructor Description DatacenterStorage()
Creates a DatacenterStorage with an emptystorage list
.DatacenterStorage(List<FileStorage> storageList)
Creates a DatacenterStorage with a givenstorage list
. -
Method Summary
Modifier and Type Method Description int
addFile(File file)
Adds a file to the first storage device that has enough capacityboolean
contains(String fileName)
Checks whether the storageList has the given file.boolean
contains(File file)
Checks whether the storageList has the given file.Datacenter
getDatacenter()
List<FileStorage>
getStorageList()
Gets the list of storage devices of the Datacenter, which is like a Disk Array.double
predictFileTransferTime(List<String> requiredFiles)
Predict the total time to transfer a list of files.void
setAllFilesOfAllStoragesToThisDatacenter()
Assigns all files of all storage devices to this Datacenter.void
setDatacenter(Datacenter datacenter)
DatacenterStorage
setStorageList(List<FileStorage> storageList)
Sets the list of storage devices of the Datacenter, which is like a Disk Array.
-
Constructor Details
-
DatacenterStorage
public DatacenterStorage()Creates a DatacenterStorage with an emptystorage list
. -
DatacenterStorage
Creates a DatacenterStorage with a givenstorage list
.- Parameters:
storageList
- the storage list to set
-
-
Method Details
-
contains
Checks whether the storageList has the given file.- Parameters:
file
- a file to be searched- Returns:
- true if successful, false otherwise
-
contains
Checks whether the storageList has the given file.- Parameters:
fileName
- a file name to be searched- Returns:
- true if successful, false otherwise
-
getStorageList
Gets the list of storage devices of the Datacenter, which is like a Disk Array.- Returns:
-
setStorageList
Sets the list of storage devices of the Datacenter, which is like a Disk Array.- Parameters:
storageList
- the new storage list- Returns:
-
setAllFilesOfAllStoragesToThisDatacenter
public void setAllFilesOfAllStoragesToThisDatacenter()Assigns all files of all storage devices to this Datacenter. -
getDatacenter
-
setDatacenter
-
predictFileTransferTime
Predict the total time to transfer a list of files.- Parameters:
requiredFiles
- the files to be transferred- Returns:
- the total predicted time to transfer the files
-
addFile
Adds a file to the first storage device that has enough capacity- Parameters:
file
- the file to add- Returns:
- a tag from
DataCloudTags
informing the result of the operation
-