ARC SDK
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DataStaging::DataDeliveryComm Class Referenceabstract

This class provides an abstract interface for the Delivery layer. More...

#include <arc/data-staging/DataDeliveryComm.h>

Inheritance diagram for DataStaging::DataDeliveryComm:
DataStaging::DataDeliveryLocalComm DataStaging::DataDeliveryRemoteComm

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.
 
Status GetStatus () const
 Obtain status of transfer.
 
std::string GetError () const
 Get explanation of error.
 
virtual operator bool () const =0
 Returns true if transfer is currently active.
 
virtual bool operator! () const =0
 Returns true if transfer is currently not active.
 

Static Public Member Functions

static DataDeliveryCommCreateInstance (DTR_ptr dtr, const TransferParameters &params)
 Factory method to get DataDeliveryComm instance.
 
static bool CheckComm (DTR_ptr dtr, std::vector< std::string > &allowed_dirs)
 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 &params)
 Start transfer with parameters taken from DTR and supplied transfer limits. More...
 

Protected Attributes

Status status_
 Current status of transfer.
 
Status status_buf_
 Latest status of transfer is read into this buffer.
 
unsigned int status_pos_
 Reading position of Status buffer.
 
Glib::Mutex lock_
 Lock to protect access to status.
 
DataDeliveryCommHandlerhandler_
 Pointer to singleton handler of all DataDeliveryComm objects.
 
std::string dtr_id
 ID of the DTR this object is handling. Used in log messages.
 
TransferParameters transfer_params
 Transfer limits.
 
Arc::Time start_
 Time transfer was started.
 
DTRLogger logger_
 Logger object. Pointer to DTR's Logger.
 

Detailed Description

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().

Member Enumeration Documentation

Communication status with transfer.

Enumerator
CommInit 

Initializing/starting transfer, rest of information not valid.

CommNoError 

Communication going on smoothly.

CommTimeout 

Communication experienced timeout.

CommClosed 

Communication channel was closed.

CommExited 

Transfer exited. Mostly same as CommClosed but exit detected before pipe closed.

CommFailed 

Transfer failed. If we have CommFailed and no error code reported that normally means segfault or external kill.

Constructor & Destructor Documentation

DataStaging::DataDeliveryComm::DataDeliveryComm ( DTR_ptr  dtr,
const TransferParameters params 
)
protected

Start transfer with parameters taken from DTR and supplied transfer limits.

Constructor should not be used directly, CreateInstance() should be used instead.

Member Function Documentation

static bool DataStaging::DataDeliveryComm::CheckComm ( DTR_ptr  dtr,
std::vector< std::string > &  allowed_dirs 
)
static

Check the delivery method is available. Calls CheckComm of the appropriate subclass.

Parameters
dtrDTR from which credentials are used
allowed_dirsfilled with list of dirs that this comm is allowed to read/write
Returns
true if selected delivery method is available
virtual void DataStaging::DataDeliveryComm::PullStatus ( )
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.


The documentation for this class was generated from the following file: