The storage service base class.
More...
#include <StorageService.h>
|
static void | createFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location) |
| Store a file at a particular mount point ex nihilo (this instantly creates the file at the storage service - zero simulation time). Will do nothing (and won't complain) if the file already exists at that location. More...
|
|
static void | deleteFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, std::shared_ptr< FileRegistryService > file_registry_service=nullptr) |
| Synchronously delete a file at a location. More...
|
|
static bool | lookupFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location) |
| Synchronously asks the storage service whether it holds a file. More...
|
|
static void | readFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location) |
| Synchronously read a file from the storage service. More...
|
|
static void | readFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location, double num_bytes) |
| Synchronously read a file from the storage service. More...
|
|
static void | writeFile (std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > location) |
| Synchronously write a file to the storage service. More...
|
|
The storage service base class.
◆ createFile()
void wrench::StorageService::createFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< FileLocation > |
location |
|
) |
| |
|
static |
Store a file at a particular mount point ex nihilo (this instantly creates the file at the storage service - zero simulation time). Will do nothing (and won't complain) if the file already exists at that location.
- Parameters
-
file | a file |
location | a file location |
- Exceptions
-
◆ deleteFile()
Synchronously delete a file at a location.
- Parameters
-
file | the file |
location | the file's location |
file_registry_service | a file registry service that should be updated once the file deletion has (successfully) completed (none if nullptr) |
- Exceptions
-
◆ getFreeSpace()
std::map< std::string, double > wrench::StorageService::getFreeSpace |
( |
| ) |
|
|
virtual |
Synchronously asks the storage service for its capacity at all its mount points.
- Returns
- The free space in bytes of each mount point, as a map
- Exceptions
-
◆ getMountPoint()
std::string wrench::StorageService::getMountPoint |
( |
| ) |
|
Get the mount point (will throw is more than one)
- Returns
- the (sole) mount point of the service
◆ getMountPoints()
std::set< std::string > wrench::StorageService::getMountPoints |
( |
| ) |
|
Get the set of mount points.
- Returns
- the set of mount points
◆ getTotalSpace()
std::map< std::string, double > wrench::StorageService::getTotalSpace |
( |
| ) |
|
|
virtual |
Get the total static capacity of the storage service (in zero simulation time)
- Returns
- capacity of the storage service (double) for each mount point, in a map
◆ hasMountPoint()
bool wrench::StorageService::hasMountPoint |
( |
std::string |
mp | ) |
|
Checked whether the storage service has a particular mount point.
- Parameters
-
- Returns
- true whether the service has that mount point
◆ hasMultipleMountPoints()
bool wrench::StorageService::hasMultipleMountPoints |
( |
| ) |
|
Checked whether the storage service has multiple mount points.
- Returns
- true whether the service has multiple mount points
◆ lookupFile()
bool wrench::StorageService::lookupFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< FileLocation > |
location |
|
) |
| |
|
static |
Synchronously asks the storage service whether it holds a file.
- Parameters
-
file | the file |
location | the file location |
- Returns
- true or false
- Exceptions
-
◆ readFile() [1/2]
void wrench::StorageService::readFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< FileLocation > |
location |
|
) |
| |
|
static |
Synchronously read a file from the storage service.
- Parameters
-
file | the file |
location | the location to read the file from |
- Exceptions
-
◆ readFile() [2/2]
void wrench::StorageService::readFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< FileLocation > |
location, |
|
|
double |
num_bytes_to_read |
|
) |
| |
|
static |
Synchronously read a file from the storage service.
- Parameters
-
file | the file |
location | the location to read the file from |
num_bytes_to_read | number of bytes to read from the file |
- Exceptions
-
◆ writeFile()
void wrench::StorageService::writeFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< FileLocation > |
location |
|
) |
| |
|
static |
Synchronously write a file to the storage service.
- Parameters
-
file | the file |
location | the location to write it to |
- Exceptions
-
The documentation for this class was generated from the following files: