|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Storage
An interface which defines the desired functionality of a storage system in a Data Grid. The 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.
HarddriveStorage
,
TapeStorage
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 file is stored in the storage or not. |
boolean |
contains(String fileName)
Checks whether a file is stored in 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 MByte. |
double |
getCapacity()
Gets the total capacity of the storage in MByte. |
double |
getCurrentSize()
Gets the current size of the storage in MByte. |
File |
getFile(String fileName)
Gets the file with the specified name. |
List |
getFileNameList()
Gets the list of file names located on this storage. |
double |
getMaxTransferRate()
Gets the maximum transfer rate of the storage in MByte/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 |
setMaxTransferRate(int rate)
Sets the maximum transfer rate of this storage system in MByte/sec. |
Method Detail |
---|
String getName()
double getCapacity()
double getCurrentSize()
double getMaxTransferRate()
double getAvailableSpace()
boolean setMaxTransferRate(int rate)
rate
- the maximum transfer rate in MB/sec
boolean isFull()
int getNumStoredFile()
boolean reserveSpace(int fileSize)
fileSize
- the size to be reserved in MB
double addReservedFile(File file)
File.getTransactionTime()
.
file
- the file to be added
boolean hasPotentialAvailableSpace(int fileSize)
fileSize
- a FileAttribute object to compare to
File getFile(String fileName)
File.getTransactionTime()
.
fileName
- the name of the needed file
List getFileNameList()
double addFile(File file)
File.getTransactionTime()
.
file
- the file to be added
double addFile(List list)
File.getTransactionTime()
.
list
- the files to be added
File deleteFile(String fileName)
File.getTransactionTime()
.
fileName
- the name of the file to be removed
double deleteFile(String fileName, File file)
File.getTransactionTime()
.
fileName
- the name of the file to be removedfile
- the file which is removed from the storage is returned
through this parameter
double deleteFile(File file)
File.getTransactionTime()
.
file
- the file which is removed from the storage is returned
through this parameter
boolean contains(String fileName)
fileName
- the name of the file we are looking for
boolean contains(File file)
file
- the file we are looking for
boolean renameFile(File file, String newName)
File.getTransactionTime()
.
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 |