wrench::FileLocation
-
class FileLocation
A class that encodes a file location.
Subclassed by wrench::ProxyLocation
Public Functions
Method to compare a file location with another.
- Parameters:
other – a file location
- Returns:
true if both locations are equivalent (always returns false if at least one location is SCRATCH)
-
std::string getDirectoryPath()
Get the location’s directory path.
- Returns:
a path
-
std::shared_ptr<DataFile> getFile()
Get the location’s file.
- Returns:
a file
-
std::string getFilePath()
Get the location’s file path.
- Returns:
a path
-
std::shared_ptr<StorageService> getStorageService()
Get the location’s storage service.
- Returns:
a storage service
-
bool isScratch() const
Get the location’s scratch-ness.
- Returns:
true if the location is SCRATCH
Set location’s storage service.
- Parameters:
storage_service – the storage service
- Returns:
The updated storage service
-
std::string toString()
Give a <ss1 name>:<mount point>:<dir>” string for the location.
- Returns:
A string
Public Static Functions
Method to compare two file locations.
- Parameters:
lhs – a file location
rhs – a file location
- Returns:
true if both locations are equivalent (always returns false if at least one location is SCRATCH)
Static location that denotes a compute service’s scratch space.
File location specifier for a storage service’s (single) mount point root.
- Parameters:
ss – a storage service (that has a single mount point)
file – a file
- Returns:
a file location specification
File location specifier given an absolute path at a storage service.
- Parameters:
ss – a storage service
file – a file
path – a path
- Returns:
a file location specification
-
static bool properPathPrefix(const std::string &path1, const std::string &path2)
Helper method to find if a path is a proper prefix of another path.
- Parameters:
path1 – a path (ALREADY SANITIZED)
path2 – another path (ALREADY SANITIZED)
- Returns:
true if one of the two paths is a proper prefix of the other
-
static std::string sanitizePath(const std::string &path)
Method to sanitize an absolute path (and make it absolute if it’s not)
- Parameters:
path – an absolute path
- Returns:
a sanitized path
File location specifier for a scratch storage.
- Parameters:
file – a file
- Returns:
a file location specification