DatacenterStorage

public class DatacenterStorage

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.

Author:Rodrigo N. Calheiros, Anton Beloglazov, Abderrahman Lahiaouni

Constructors

DatacenterStorage

public DatacenterStorage()

Creates a DatacenterStorage with an empty storage list.

DatacenterStorage

public DatacenterStorage(List<FileStorage> storageList)

Creates a DatacenterStorage with a given storage list.

Parameters:
  • storageList – the storage list to set

Methods

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

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

getDatacenter

public Datacenter getDatacenter()

getStorageList

public List<FileStorage> getStorageList()

Gets the list of storage devices of the Datacenter, which is like a Disk Array.

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

setAllFilesOfAllStoragesToThisDatacenter

public void setAllFilesOfAllStoragesToThisDatacenter()

Assigns all files of all storage devices to this Datacenter.

setDatacenter

public void setDatacenter(Datacenter datacenter)

setStorageList

public final DatacenterStorage setStorageList(List<FileStorage> storageList)

Sets the list of storage devices of the Datacenter, which is like a Disk Array.

Parameters:
  • storageList – the new storage list