DataStaging::DataDeliveryComm Class Reference

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

#include <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
}

Public Member Functions

virtual ~DataDeliveryComm ()
Status GetStatus () const
std::string GetError () const
virtual operator bool () const =0
virtual bool operator! () const =0

Static Public Member Functions

static DataDeliveryCommCreateInstance (DTR_ptr dtr, const TransferParameters &params)
static bool CheckComm (DTR_ptr dtr, std::vector< std::string > &allowed_dirs)

Protected Member Functions

virtual void PullStatus ()=0
 DataDeliveryComm (DTR_ptr dtr, const TransferParameters &params)

Protected Attributes

Status status_
Status status_buf_
unsigned int status_pos_
Glib::Mutex lock_
DataDeliveryCommHandlerhandler_
std::string dtr_id
TransferParameters transfer_params
Arc::Time start_
DTRLogger 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 is available. Calls CheckComm of the appropriate subclass.

Parameters:
dtr DTR from which credentials are used
allowed_dirs List of dirs that this comm is allowed to read/write

Reimplemented in DataStaging::DataDeliveryLocalComm, and DataStaging::DataDeliveryRemoteComm.

virtual void DataStaging::DataDeliveryComm::PullStatus (  )  [protected, pure 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::DataDeliveryLocalComm, and DataStaging::DataDeliveryRemoteComm.


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:35 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3