wrench::StorageService
-
class StorageService : public wrench::Service
The storage service base class.
Subclassed by wrench::CompoundStorageService, wrench::SimpleStorageService, wrench::XRootD::Node
Public Functions
Create a file at the storage service (in zero simulated time)
- Parameters:
file – a file
Create a file at the storage service (in zero simulated time)
- Parameters:
file – a file
path – a path
Create a file at the storage service (in zero simulated time)
- Parameters:
location – a location
Delete a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
Delete a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
path – a path
Delete a file at the storage service (incurs simulated overheads)
- Parameters:
location – a location
-
inline virtual std::string getBaseRootPath()
Get the storage’s service base root path.
- Returns:
a path
-
virtual double getBufferSize() const = 0
Determine the storage service’s buffer size.
- Returns:
a size in bytes
Get a file’s last write date at the storage service (in zero simulated time)
- Parameters:
file – a file
- Returns:
a date in seconds
Get a file’s last write date at the storage service (in zero simulated time)
- Parameters:
file – a file
path – a path
- Returns:
a date in seconds
Get a file’s last write date at the storage service (in zero simulated time)
- Parameters:
location – a location
- Returns:
a date in seconds
Get a file’s last write date at a location (in zero simulated time)
File write date methods
- Parameters:
location – a location
- Returns:
a date in seconds, or -1 if the file is not found
-
virtual double getLoad() = 0
Get the storage service’s load.
Service load methods
- Returns:
a load metric
-
double getTotalFreeSpace()
Get the storage service’s total free space (incurs simulated overhead)
Synchronously asks the storage service for its total free space capacity, that is, the total capacity at the “/” path. Note that this doesn’t mean that that free space could be used to store a single file, as the storage service may have file systems at multiple mount points, may me a front-end for a set of storage systems, etc.
Service free space method
- Returns:
a capacity in bytes
- Returns:
A number of bytes
-
virtual double getTotalFreeSpaceAtPath(const std::string &path)
Get the storage service’s free space at a path (incurs simulated overhead)
Synchronously asks the storage service for its total free space capacity at a particular path. Note that this doesn’t mean that that free space could be used to store a single file, as the storage service may have file systems at multiple mount points, may be a front-end for a set of storage systems, etc.
Service free space method
path a path
- Parameters:
path – a path (if empty, “/” will be used)
- Returns:
a capacity in bytes
- Returns:
A number of bytes
-
virtual double getTotalSpace() = 0
Get the storage service’s total space (in zero simulated time)
Service total space method
- Returns:
a capacity in bytes
Determines whether a file is present at the storage service (in zero simulated time)
- Parameters:
file – a file
- Returns:
true if the file is present, false otherwise
Determines whether a file is present at the storage service (in zero simulated time)
- Parameters:
file – a file
path – a path
- Returns:
true if the file is present, false otherwise
Determines whether a file is present at the storage service (in zero simulated time)
- Parameters:
location – a location
- Returns:
true if the file is present, false otherwise
-
virtual bool isBufferized() const = 0
Determine whether the storage service is bufferized.
- Returns:
true if bufferized, false otherwise
-
inline bool isScratch() const
Determines whether the storage service is a scratch service of a ComputeService.
- Returns:
true if it is, false otherwise
Lookup whether a file exists on the storage service (incurs simulated overheads)
- Parameters:
file – a file
- Returns:
true if the file is present, or false
Lookup whether a file exists on the storage service (incurs simulated overheads)
- Parameters:
file – a file
path – a path
- Returns:
true if the file is present, or false
Lookup whether a file exists at a location on the storage service (incurs simulated overheads)
- Parameters:
location – a location
- Returns:
true if the file is present, or false
Read a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
Read a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
path – a path
Read a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
path – a path
num_bytes – a number of bytes to read
Read a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
num_bytes – a number of bytes to read
Read a file at the storage service (incurs simulated overheads)
- Parameters:
location – a location
Read a file at the storage service (incurs simulated overheads)
- Parameters:
location – a location
num_bytes – a number of bytes to read
-
virtual void removeDirectory(const std::string &path) = 0
Remove a directory and all files at the storage service (in zero simulated time)
- Parameters:
path – a path
Remove a file at the storage service (in zero simulated time)
- Parameters:
file – a file
Remove a file at the storage service (in zero simulated time)
- Parameters:
file – a file
path – a path
Remove a file at the storage service (in zero simulated time)
- Parameters:
location – a location
-
virtual void stop() override
Stop the servier.
Stop the service.
-
inline virtual double traceTotalFreeSpace()
Get the storage service’s total free space (no simulated overhead)
Service free space tracing (doesn’t incur simulated overhead)
- Returns:
Current free space in bytes
Write a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
Write a file at the storage service (incurs simulated overheads)
- Parameters:
file – a file
path – a path
Write a file at the storage service (incurs simulated overheads)
- Parameters:
location – a location
Public Static Functions
Copy a file from one location to another.
Synchronously ask the storage service to read a file from another storage service.
- Parameters:
src_location – a source location
dst_location – a destination location
src_location – the location where to read the file
dst_location – the location where to write the file
- Throws:
std::invalid_argument –
Create a file at a location (in zero simulated time)
File creation methods
- Parameters:
location – a location
Delete a file at a location (incurs simulated overheads)
File deletion methods
- Parameters:
location – a location
Determines whether a file is present at a location (in zero simulated time)
Non-Simulation methods File lookup methods
- Parameters:
location – a location
- Returns:
true if the file is present, false otherwise
Lookup whether a file exists at a location (incurs simulated overheads)
File Lookup methods (in simulation)
- Parameters:
location – a location
- Returns:
true if the file is present at the location, or false
Read a file at a location (incurs simulated overheads)
File read methods
- Parameters:
location – a location
Read a file at a location (incurs simulated overheads)
- Parameters:
location – a location
num_bytes – a number of bytes to read
Helper method to read multiple files.
Synchronously and sequentially read a set of files from storage services.
- Parameters:
locations – a map of files to locations
locations – a map of files to locations
- Throws:
std::runtime_error –
Remove a file at a location (in zero simulated time)
File removal methods
- Parameters:
location – a location
Write a file at a location (incurs simulated overheads)
File write methods
- Parameters:
location – a location
Helper method to write multiple files.
Synchronously and sequentially upload a set of files from storage services.
- Parameters:
locations – a map of files to locations
locations – a map of files to locations
- Throws:
std::runtime_error –