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:
  • Field Details

    • NULL

      static final FileStorage NULL
      An attribute that implements the Null Object Design Pattern for FileStorage objects.
    • LOGGER

      static final org.slf4j.Logger LOGGER
    • DEF_LATENCY_SECS

      static final double DEF_LATENCY_SECS
      Default rotational latency of this storage in seconds.
      See Also:
    • DEF_SEEK_TIME_SECS

      static final double DEF_SEEK_TIME_SECS
      Default average seek time of the storage in seconds.
      See Also:
    • DEF_MAX_TRANSF_RATE_MBITS_SEC

      static final int DEF_MAX_TRANSF_RATE_MBITS_SEC
      Default 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

      FileStorage setMaxTransferRate(double maxTransferRate)
      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 and SanStorage 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

      FileStorage setLatency(double latency)
      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