|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectgridsim.datagrid.storage.HarddriveStorage
An implementation of a storage system. It simulates the behaviour of a typical harddrive storage. The default values for this storage are those of a Maxtor DiamonMax 10 ATA harddisk with the following parameters:
Storage| Constructor Summary | |
HarddriveStorage(double capacity)
Creates a new harddrive storage with a given capacity. |
|
HarddriveStorage(String name,
double capacity)
Creates a new harddrive storage with a given name and capacity. |
|
| Method Summary | |
double |
addFile(File file)
Adds a file to the storage. |
double |
addFile(List list)
Adds a set of files to the storage. |
double |
addReservedFile(File file)
Adds a file for which the space has already been reserved. |
boolean |
contains(File file)
Checks whether a certain file is on the storage or not. |
boolean |
contains(String fileName)
Checks whether a certain file is on the storage or not. |
double |
deleteFile(File file)
Removes a file from the storage. |
File |
deleteFile(String fileName)
Removes a file from the storage. |
double |
deleteFile(String fileName,
File file)
Removes a file from the storage. |
double |
getAvailableSpace()
Gets the available space on this storage in MB. |
double |
getAvgSeekTime()
Gets the average seek time of the harddrive in seconds. |
double |
getCapacity()
Gets the total capacity of the storage in MB. |
double |
getCurrentSize()
Gets the current size of the stored files in MB. |
File |
getFile(String fileName)
Gets the file with the specified name. |
List |
getFileNameList()
Gets the list of file names located on this storage. |
double |
getLatency()
Gets the latency of this harddrive in seconds. |
double |
getMaxTransferRate()
Gets the maximum transfer rate of the storage in MB/sec. |
String |
getName()
Gets the name of the storage. |
int |
getNumStoredFile()
Gets the number of files stored on this storage. |
boolean |
hasPotentialAvailableSpace(int fileSize)
Checks whether there is enough space on the storage for a certain file. |
boolean |
isFull()
Checks if the storage is full or not. |
boolean |
renameFile(File file,
String newName)
Renames a file on the storage. |
boolean |
reserveSpace(int fileSize)
Makes a reservation of the space on the storage to store a file. |
boolean |
setAvgSeekTime(double seekTime)
Sets the average seek time of the storage in seconds. |
boolean |
setAvgSeekTime(double seekTime,
ContinuousGenerator gen)
Sets the average seek time and a new generator of seek times in seconds. |
boolean |
setLatency(double latency)
Sets the latency of this harddrive in seconds. |
boolean |
setMaxTransferRate(int rate)
Sets the maximum transfer rate of this storage system in MB/sec. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HarddriveStorage(String name,
double capacity)
throws ParameterException
name - the name of the new harddrive storagecapacity - the capacity in MByte
ParameterException - when the name and the capacity are not valid
public HarddriveStorage(double capacity)
throws ParameterException
capacity - the capacity in MByte
ParameterException - when the capacity is not valid| Method Detail |
public double getAvailableSpace()
getAvailableSpace in interface Storagepublic boolean isFull()
isFull in interface Storagepublic int getNumStoredFile()
getNumStoredFile in interface Storagepublic boolean reserveSpace(int fileSize)
reserveSpace in interface StoragefileSize - the size to be reserved in MB
public double addReservedFile(File file)
File.getTransactionTime().
addReservedFile in interface Storagefile - the file to be added
public boolean hasPotentialAvailableSpace(int fileSize)
hasPotentialAvailableSpace in interface StoragefileSize - a FileAttribute object to compare to
public double getCapacity()
getCapacity in interface Storagepublic double getCurrentSize()
getCurrentSize in interface Storagepublic String getName()
getName in interface Storagepublic boolean setLatency(double latency)
latency - the new latency in seconds
public double getLatency()
public boolean setMaxTransferRate(int rate)
setMaxTransferRate in interface Storagerate - the maximum transfer rate in MB/sec
public double getMaxTransferRate()
getMaxTransferRate in interface Storagepublic boolean setAvgSeekTime(double seekTime)
seekTime - the average seek time in seconds
public boolean setAvgSeekTime(double seekTime,
ContinuousGenerator gen)
seekTime - the average seek time in secondsgen - the ContinuousGenerator which generates seek times
public double getAvgSeekTime()
public File getFile(String fileName)
File.getTransactionTime().
getFile in interface StoragefileName - the name of the needed file
public List getFileNameList()
getFileNameList in interface Storagepublic double addFile(File file)
File.getTransactionTime().
addFile in interface Storagefile - the file to be added
public double addFile(List list)
File.getTransactionTime().
addFile in interface Storagelist - the files to be added
public File deleteFile(String fileName)
File.getTransactionTime().
deleteFile in interface StoragefileName - the name of the file to be removed
public double deleteFile(String fileName,
File file)
File.getTransactionTime().
deleteFile in interface StoragefileName - the name of the file to be removedfile - the file which is removed from the storage is returned
through this parameter
public double deleteFile(File file)
File.getTransactionTime().
deleteFile in interface Storagefile - the file which is removed from the storage is returned
through this parameter
public boolean contains(String fileName)
contains in interface StoragefileName - the name of the file we are looking for
public boolean contains(File file)
contains in interface Storagefile - the file we are looking for
public boolean renameFile(File file,
String newName)
File.getTransactionTime().
renameFile in interface Storagefile - the file we would like to renamenewName - the new name of the file
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||