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 Details

    • DatacenterStorage

      public DatacenterStorage()
      Creates a DatacenterStorage with an empty storage list.
    • DatacenterStorage

      public DatacenterStorage(List<SanStorage> storageList)
      Creates a DatacenterStorage with a given storage list.
      Parameters:
      storageList - the storage list to set
  • Method Details

    • contains

      public boolean contains(File file)
      Checks whether the storageList has the given file.
      Parameters:
      file - a file to be searched
      Returns:
      true if successful, false otherwise
    • contains

      public boolean contains(String fileName)
      Checks whether the storageList has the given file.
      Parameters:
      fileName - a file name to be searched
      Returns:
      true if successful, false otherwise
    • getStorageList

      public List<SanStorage> getStorageList()
      Gets the list of storage devices of the Datacenter, which is like a Disk Array.
      Returns:
    • setStorageList

      public final DatacenterStorage setStorageList(List<SanStorage> storageList)
      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

      public Datacenter getDatacenter()
    • setDatacenter

      public void setDatacenter(Datacenter datacenter)
    • predictFileTransferTime

      public double predictFileTransferTime(List<String> requiredFiles)
      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

      public int addFile(File file)
      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