wrench::StorageService Class Reference

The storage service base class. More...

#include <StorageService.h>

Inheritance diagram for wrench::StorageService:
wrench::Service wrench::SimpleStorageService

Public Member Functions

virtual void deleteFile (WorkflowFile *file, FileRegistryService *file_registry_service=nullptr)
 Synchronously asks the storage service to delete a file copy. More...
 
virtual void deleteFile (WorkflowFile *file, std::string dst_dir, FileRegistryService *file_registry_service=nullptr)
 Synchronously ask the storage service to delete a file copy. More...
 
virtual double getFreeSpace ()
 Synchronously asks the storage service for its capacity. More...
 
double getTotalSpace ()
 Get the total static capacity of the storage service (in zero simulation time) More...
 
virtual bool lookupFile (WorkflowFile *file)
 Synchronously asks the storage service whether it holds a file. More...
 
virtual bool lookupFile (WorkflowFile *file, std::string dst_dir)
 Synchronously asks the storage service whether it holds a file. More...
 
void stop ()
 Stop the service.
 
- Public Member Functions inherited from wrench::Service
std::string getHostname ()
 Get the name of the host on which the service is / will be running. More...
 
double getNetworkTimeoutValue ()
 Returns the service's network timeout value. More...
 
bool getPropertyValueAsBoolean (std::string)
 Get a property of the Service as a boolean. More...
 
double getPropertyValueAsDouble (std::string)
 Get a property of the Service as a double. More...
 
std::string getPropertyValueAsString (std::string)
 Get a property of the Service as a string. More...
 
bool isUp ()
 Returns true if the service is UP, false otherwise. More...
 
void setNetworkTimeoutValue (double value)
 Sets the service's network timeout value. More...
 
void start (std::shared_ptr< Service > this_service, bool daemonize, bool auto_restart)
 Start the service. More...
 

Additional Inherited Members

- Public Types inherited from wrench::Service
enum  State { UP, DOWN }
 Service states. More...
 

Detailed Description

The storage service base class.

Member Function Documentation

◆ deleteFile() [1/2]

void wrench::StorageService::deleteFile ( WorkflowFile file,
FileRegistryService file_registry_service = nullptr 
)
virtual

Synchronously asks the storage service to delete a file copy.

Parameters
filethe file
file_registry_servicea file registry service that should be updated once the file deletion has (successfully) completed (none if nullptr)
Exceptions
WorkflowExecutionException
std::runtime_error
std::invalid_argument

◆ deleteFile() [2/2]

void wrench::StorageService::deleteFile ( WorkflowFile file,
std::string  dst_partition,
FileRegistryService file_registry_service = nullptr 
)
virtual

Synchronously ask the storage service to delete a file copy.

Parameters
filethe file
dst_partitionthe partition in which to delete the file
file_registry_servicea file registry service that should be updated once the file deletion has (successfully) completed (none if nullptr)
Exceptions
WorkflowExecutionException
std::runtime_error
std::invalid_argument

◆ getFreeSpace()

double wrench::StorageService::getFreeSpace ( )
virtual

Synchronously asks the storage service for its capacity.

Returns
The free space in bytes
Exceptions
WorkflowExecutionException
std::runtime_error

◆ getTotalSpace()

double wrench::StorageService::getTotalSpace ( )

Get the total static capacity of the storage service (in zero simulation time)

Returns
capacity of the storage service (double)

◆ lookupFile() [1/2]

bool wrench::StorageService::lookupFile ( WorkflowFile file)
virtual

Synchronously asks the storage service whether it holds a file.

Parameters
filethe file
Returns
true or false
Exceptions
WorkflowExecutionException
std::invalid_arguments

◆ lookupFile() [2/2]

bool wrench::StorageService::lookupFile ( WorkflowFile file,
std::string  dst_partition 
)
virtual

Synchronously asks the storage service whether it holds a file.

Parameters
filethe file
dst_partitionthe partition in which to perform the lookup
Returns
true or false
Exceptions
WorkflowExecutionException
std::runtime_error
std::invalid_arguments

The documentation for this class was generated from the following files:
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/services/storage/StorageService.h
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/services/storage/StorageService.cpp