wrench::StorageService
-
class StorageService : public wrench::Service
The storage service base class.
Subclassed by wrench::CompoundStorageService, wrench::SimpleStorageService, wrench::StorageServiceProxy, 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
Decrement the number of operations for a location.
- 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
Delete a file on the storage service.
- Parameters:
answer_mailbox – the answer mailbox to which the reply from the server should be sent
location – the location to delete
wait_for_answer – whether this call should
-
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
Increment the number of operations for a location.
- Parameters:
location – a location
-
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
Asks the storage service whether it holds a file.
- Parameters:
answer_mailbox – the answer mailbox to which the reply from the server should be sent
location – the location to lookup
- Returns:
true if the file is present, false otherwise
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
Read a file from the storage service.
- Parameters:
answer_mailbox – the mailbox on which to expect the answer
location – the location
num_bytes – the number of bytes to read
wait_for_answer – whether to wait for the answer
-
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
Reserve space at the storage service.
- Parameters:
location – a location
- Returns:
true if success, false otherwise
-
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
Unreserve space at the storage service.
- Parameters:
location – a location
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
Synchronously write a file to the storage service.
- Parameters:
answer_mailbox – the mailbox on which to expect the answer
location – the location
wait_for_answer – whether to wait for the answer
- Throws:
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
Initiate a file copy from one location to another.
Asynchronously ask for a file copy between two storage services.
- Parameters:
answer_mailbox – a mailbox on which to receive completion/failure notification
src_location – a source location
dst_location – a destination location
answer_mailbox – the mailbox to which a notification message will be sent
src_location – the source location
dst_location – the destination location
- Throws:
std::invalid_argument –
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 –