|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object HarddriveStorage
public class 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 validpublic HarddriveStorage(double capacity) throws ParameterException
capacity
- the capacity in MByte
ParameterException
- when the capacity is not validMethod Detail |
---|
public double getAvailableSpace()
getAvailableSpace
in interface Storage
public boolean isFull()
isFull
in interface Storage
public int getNumStoredFile()
getNumStoredFile
in interface Storage
public boolean reserveSpace(int fileSize)
reserveSpace
in interface Storage
fileSize
- the size to be reserved in MB
public double addReservedFile(File file)
File.getTransactionTime()
.
addReservedFile
in interface Storage
file
- the file to be added
public boolean hasPotentialAvailableSpace(int fileSize)
hasPotentialAvailableSpace
in interface Storage
fileSize
- a FileAttribute object to compare to
public double getCapacity()
getCapacity
in interface Storage
public double getCurrentSize()
getCurrentSize
in interface Storage
public String getName()
getName
in interface Storage
public boolean setLatency(double latency)
latency
- the new latency in seconds
public double getLatency()
public boolean setMaxTransferRate(int rate)
setMaxTransferRate
in interface Storage
rate
- the maximum transfer rate in MB/sec
public double getMaxTransferRate()
getMaxTransferRate
in interface Storage
public 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 Storage
fileName
- the name of the needed file
public List getFileNameList()
getFileNameList
in interface Storage
public double addFile(File file)
File.getTransactionTime()
.
addFile
in interface Storage
file
- the file to be added
public double addFile(List list)
File.getTransactionTime()
.
addFile
in interface Storage
list
- the files to be added
public File deleteFile(String fileName)
File.getTransactionTime()
.
deleteFile
in interface Storage
fileName
- the name of the file to be removed
public double deleteFile(String fileName, File file)
File.getTransactionTime()
.
deleteFile
in interface Storage
fileName
- 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 Storage
file
- the file which is removed from the storage is returned
through this parameter
public boolean contains(String fileName)
contains
in interface Storage
fileName
- the name of the file we are looking for
public boolean contains(File file)
contains
in interface Storage
file
- the file we are looking for
public boolean renameFile(File file, String newName)
File.getTransactionTime()
.
renameFile
in interface Storage
file
- the file we would like to renamenewName
- the new name of the file
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |