All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudsimplus.resources.FileStorage Maven / Gradle / Ivy

Go to download

CloudSim Plus: A modern, highly extensible and easier-to-use Java 8+ Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services

The newest version!
/*
 * Title:        CloudSim Toolkit
 * Description:  CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 *
 * Copyright (c) 2009-2012, The University of Melbourne, Australia
 */

package org.cloudsimplus.resources;

import org.cloudsimplus.hosts.Host;
import org.cloudsimplus.network.switches.Switch;
import org.cloudsimplus.vms.Vm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 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
 * @author Anthony Sulistio
 * @author Manoel Campos da Silva Filho
 * @see Hard disk drive performance characteristics
 */
public interface FileStorage extends Resource {
    /**
     * An attribute that implements the Null Object Design Pattern for {@link FileStorage}
     * objects.
     */
    FileStorage NULL = new FileStorageNull();

    Logger LOGGER = LoggerFactory.getLogger(HarddriveStorage.class.getSimpleName());

    /**
     * Default rotational latency of this storage in seconds.
     */
    double DEF_LATENCY_SECS = 0.00417;

    /**
     * Default average seek time of the storage in seconds.
     */
    double DEF_SEEK_TIME_SECS = 0.009;

    /**
     * Default maximum transfer rate of this storage system in Mega-bits/sec,
     * i.e., the physical device reading speed.
     */
    int DEF_MAX_TRANSF_RATE_MBITS_SEC = 133 * 8;

    /**
     * Gets the maximum local transfer rate of the storage in Mega-bits/sec,
     * i.e., the physical device reading speed.
     *
     * @return the maximum transfer rate in Mega-bits/sec
     * @see #setMaxTransferRate(double)
     */
    double getMaxTransferRate();

    /**
     * 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 {@link Host}, {@link Vm}, {@link Switch} * and {@link SanStorage} use such a data unit.

* * @param maxTransferRate the maximum transfer rate in Mbits/sec * @throws IllegalArgumentException if the value is lower than 1 * @return */ FileStorage setMaxTransferRate(double maxTransferRate); /** * Sets the rotational latency of this storage in seconds (if any). * * @param latency the new latency in seconds * @throws IllegalArgumentException if the value is lower than 0 * @return */ FileStorage setLatency(double latency); /** * Gets the rotational latency of this storage in seconds (if any). * * @return the read latency in seconds */ double getLatency(); /** * Gets the transfer time of a given file. * * @param fileSize the size of the file to compute the transfer time (in MByte) * @return the transfer time in seconds */ double getTransferTime(int fileSize); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy