ARC SDK
|
This class provides an abstract interface for the Delivery layer. More...
#include <arc/data-staging/DataDeliveryComm.h>
Data Structures | |
struct | Status |
Plain C struct to pass information from executing process back to main thread. More... | |
Public Types | |
enum | CommStatusType { CommInit, CommNoError, CommTimeout, CommClosed, CommExited, CommFailed } |
Communication status with transfer. More... | |
Public Member Functions | |
virtual | ~DataDeliveryComm () |
Destroy object. This stops any ongoing transfer and cleans up resources. More... | |
Status | GetStatus () const |
Obtain status of transfer. More... | |
std::string | GetError () const |
Get explanation of error. More... | |
virtual | operator bool () const =0 |
Returns true if transfer is currently active. More... | |
virtual bool | operator! () const =0 |
Returns true if transfer is currently not active. More... | |
Static Public Member Functions | |
static DataDeliveryComm * | CreateInstance (DTR_ptr dtr, const TransferParameters ¶ms) |
Factory method to get DataDeliveryComm instance. More... | |
static bool | CheckComm (DTR_ptr dtr, std::vector< std::string > &allowed_dirs, std::string &load_avg) |
Check the delivery method is available. Calls CheckComm of the appropriate subclass. More... | |
Protected Member Functions | |
virtual void | PullStatus ()=0 |
Check for new state and fill state accordingly. More... | |
DataDeliveryComm (DTR_ptr dtr, const TransferParameters ¶ms) | |
Start transfer with parameters taken from DTR and supplied transfer limits. More... | |
Protected Attributes | |
Status | status_ |
Current status of transfer. More... | |
Status | status_buf_ |
Latest status of transfer is read into this buffer. More... | |
unsigned int | status_pos_ |
Reading position of Status buffer. More... | |
Glib::Mutex | lock_ |
Lock to protect access to status. More... | |
DataDeliveryCommHandler * | handler_ |
Pointer to singleton handler of all DataDeliveryComm objects. More... | |
TransferParameters | transfer_params |
Transfer limits. More... | |
Arc::Time | start_ |
Time transfer was started. More... | |
DTRLogger | logger_ |
Logger object. Pointer to DTR's Logger. More... | |
Friends | |
class | DataDeliveryCommHandler |
This class provides an abstract interface for the Delivery layer.
Different implementations provide different ways of providing Delivery functionality. DataDeliveryLocalComm launches a local process to perform the transfer and DataDeliveryRemoteComm contacts a remote service which performs the transfer. The implementation is chosen depending on what is set in the DTR, which the Scheduler should set based on various factors.
CreateInstance() should be used to get a pointer to the instantiated object. This also starts the transfer. Deleting this object stops the transfer and cleans up any used resources. A singleton instance of DataDeliveryCommHandler regularly polls all active transfers using PullStatus() and fills the Status object with current information, which can be obtained through GetStatus().
Communication status with transfer.
|
protected |
Start transfer with parameters taken from DTR and supplied transfer limits.
Constructor should not be used directly, CreateInstance() should be used instead.
|
inlinevirtual |
Destroy object. This stops any ongoing transfer and cleans up resources.
|
static |
Check the delivery method is available. Calls CheckComm of the appropriate subclass.
dtr | DTR from which credentials are used |
allowed_dirs | filled with list of dirs that this comm is allowed to read/write |
load_avg | filled with the load average reported by the service |
|
static |
Factory method to get DataDeliveryComm instance.
|
inline |
Get explanation of error.
Status DataStaging::DataDeliveryComm::GetStatus | ( | ) | const |
Obtain status of transfer.
|
pure virtual |
Returns true if transfer is currently active.
Implemented in DataStaging::DataDeliveryRemoteComm, and DataStaging::DataDeliveryLocalComm.
|
pure virtual |
Returns true if transfer is currently not active.
Implemented in DataStaging::DataDeliveryRemoteComm, and DataStaging::DataDeliveryLocalComm.
|
protectedpure virtual |
Check for new state and fill state accordingly.
This method is periodically called by the comm handler to obtain status info. It detects communication and delivery failures and delivery termination.
Implemented in DataStaging::DataDeliveryRemoteComm, and DataStaging::DataDeliveryLocalComm.
|
protected |
Pointer to singleton handler of all DataDeliveryComm objects.
|
protected |
Lock to protect access to status.
|
protected |
Time transfer was started.
|
protected |
Current status of transfer.
|
protected |
Latest status of transfer is read into this buffer.
|
protected |
Reading position of Status buffer.
|
protected |
Transfer limits.