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_commport – the answer commport 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 sg_size_t 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
-
inline virtual std::shared_ptr<simgrid::fsmod::FileSystem> getFileSystem()
Return the storage service’s file system If none, throws an std::runtime_error exception.
-
virtual double getLoad() = 0
Get the storage service’s load.
Service load methods
- Returns:
a load metric
-
inline virtual std::string getMountPoint()
Return the storage service’s default mountpoint, if any. If none, throws an std::runtime_error exception.
-
inline virtual std::set<std::string> getMountPoints()
Return the storage service’s mountpoints. If none, throws an std::runtime_error exception.
-
inline virtual unsigned long getTotalFilesZeroTime()
Get the number of files registered to the filesystem(s) associated with this service (no simulated overhead)
Service number of allocated files tracing (doesn’t incur simulated overhead)
- Returns:
Current number of registered Datafile for all filesystem(s) from this service
-
virtual sg_size_t getTotalFreeSpace()
Get the storage service’s total free space (incurs simulated overhead)
Synchronously asks the storage service for its total free space capacity.
Service free space method
- Returns:
a capacity in bytes
- Returns:
A number of bytes
-
virtual sg_size_t 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 (i.e., at the partition that holds that path). If the path is the empty string, then it’s the sum total free space across all partitions. If the path is invalid, then this method returns 0.
Service free space method
path a path
- Parameters:
path – a path
- Returns:
a capacity in bytes
- Returns:
A number of bytes (or 0 if the path is invalid)
-
inline virtual sg_size_t getTotalFreeSpaceZeroTime()
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
-
virtual sg_size_t 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
Asks the storage service whether it holds a file.
- Parameters:
answer_commport – the answer commport 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_commport – the commport 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.
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_commport – the commport on which to expect the answer
location – the location
num_bytes_to_write – the number of bytes to write to the file.
wait_for_answer – whether to wait for the answer
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
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_commport – a commport_name on which to receive completion/failure notification
src_location – a source location
dst_location – a destination location
answer_commport – the commport to which a notification message will be sent
src_location – the source location
dst_location – the destination location
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
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