ARC SDK
|
Data Transfer Request. More...
#include <arc/data-staging/DTR.h>
Public Member Functions | |
DTR (const std::string &source, const std::string &destination, const Arc::UserConfig &usercfg, const std::string &jobid, const uid_t &uid, DTRLogger log) | |
Normal constructor. More... | |
~DTR () | |
Empty destructor. | |
operator bool () const | |
Is DTR valid? | |
bool | operator! () const |
Is DTR not valid? | |
void | registerCallback (DTRCallback *cb, StagingProcesses owner) |
Register callback objects to be used during DTR processing. More... | |
void | reset () |
Reset information held on this DTR, such as resolved replicas, error state etc. More... | |
void | set_id (const std::string &id) |
Set the ID of this DTR. Useful when passing DTR between processes. | |
std::string | get_id () const |
Get the ID of this DTR. | |
std::string | get_short_id () const |
Get an abbreviated version of the DTR ID - useful to reduce logging verbosity. | |
Arc::DataHandle & | get_source () |
Get source handle. Return by reference since DataHandle cannot be copied. | |
Arc::DataHandle & | get_destination () |
Get destination handle. Return by reference since DataHandle cannot be copied. | |
std::string | get_source_str () const |
Get source as a string. | |
std::string | get_destination_str () const |
Get destination as a string. | |
const Arc::UserConfig & | get_usercfg () const |
Get the UserConfig object associated with this DTR. | |
void | set_timeout (time_t value) |
Set the timeout for processing this DTR. | |
Arc::Time | get_timeout () const |
Get the timeout for processing this DTR. | |
void | set_process_time (const Arc::Period &process_time) |
Set the next processing time to current time + given time. | |
Arc::Time | get_process_time () const |
Get the next processing time for the DTR. | |
Arc::Time | get_creation_time () const |
Get the creation time. | |
Arc::Time | get_modification_time () const |
Get the modification time. | |
std::string | get_parent_job_id () const |
Get the parent job ID. | |
void | set_priority (int pri) |
Set the priority. | |
int | get_priority () const |
Get the priority. | |
void | set_rfc_proxy (bool rfc) |
Set whether credentials are type RFC proxy. | |
bool | is_rfc_proxy () const |
Get whether credentials are type RFC proxy. | |
void | set_transfer_share (const std::string &share_name) |
Set the transfer share. sub_share is automatically added to transfershare. | |
std::string | get_transfer_share () const |
Get the transfer share. sub_share is automatically added to transfershare. | |
void | set_sub_share (const std::string &share) |
Set sub-share. | |
std::string | get_sub_share () const |
Get sub-share. | |
void | set_tries_left (unsigned int tries) |
Set the number of attempts remaining. | |
unsigned int | get_tries_left () const |
Get the number of attempts remaining. | |
unsigned int | get_initial_tries () const |
Get the initial number of attempts (set by set_tries_left()) | |
void | decrease_tries_left () |
Decrease attempt number. | |
void | set_status (DTRStatus stat) |
Set the status. Protected by lock. | |
DTRStatus | get_status () |
Get the status. Protected by lock. | |
void | set_error_status (DTRErrorStatus::DTRErrorStatusType error_stat, DTRErrorStatus::DTRErrorLocation error_loc, const std::string &desc="") |
Set the error status. More... | |
void | reset_error_status () |
Set the error status back to NONE_ERROR and clear other fields. | |
DTRErrorStatus | get_error_status () |
Get the error status. | |
void | set_bytes_transferred (unsigned long long int bytes) |
Set bytes transferred (should be set by whatever is controlling the transfer) | |
unsigned long long int | get_bytes_transferred () const |
Get current number of bytes transferred. | |
void | set_cancel_request () |
Set the DTR to be cancelled. | |
bool | cancel_requested () const |
Returns true if cancellation has been requested. | |
void | set_delivery_endpoint (const Arc::URL &endpoint) |
Set delivery endpoint. | |
const Arc::URL & | get_delivery_endpoint () const |
Returns delivery endpoint. | |
void | add_problematic_delivery_service (const Arc::URL &endpoint) |
Add problematic endpoint. More... | |
const std::vector< Arc::URL > & | get_problematic_delivery_services () const |
Get all problematic endpoints. | |
void | host_cert_for_remote_delivery (bool host) |
Set the flag for using host certificate for contacting remote delivery services. | |
bool | host_cert_for_remote_delivery () const |
Get the flag for using host certificate for contacting remote delivery services. | |
void | set_cache_file (const std::string &filename) |
Set cache filename. | |
std::string | get_cache_file () const |
Get cache filename. | |
void | set_cache_parameters (const DTRCacheParameters ¶m) |
Set cache parameters. | |
const DTRCacheParameters & | get_cache_parameters () const |
Get cache parameters. | |
void | set_cache_state (CacheState state) |
Set the cache state. | |
CacheState | get_cache_state () const |
Get the cache state. | |
void | set_mapped_source (const std::string &file="") |
Set the mapped file. | |
std::string | get_mapped_source () const |
Get the mapped file. | |
StagingProcesses | get_owner () const |
Find the DTR owner. | |
Arc::User | get_local_user () const |
Get the local user information. | |
void | set_replication (bool rep) |
Set replication flag. | |
bool | is_replication () const |
Get replication flag. | |
void | set_force_registration (bool force) |
Set force replication flag. | |
bool | is_force_registration () const |
Get force replication flag. | |
void | set_bulk_start (bool value) |
Set bulk start flag. | |
bool | get_bulk_start () const |
Get bulk start flag. | |
void | set_bulk_end (bool value) |
Set bulk end flag. | |
bool | get_bulk_end () const |
Get bulk start flag. | |
bool | bulk_possible () |
Whether bulk operation is possible according to current state and src/dest. | |
const DTRLogger & | get_logger () const |
Get Logger object, so that processes can log to this DTR's log. | |
void | connect_logger () |
Connect log destinations to logger. Only needs to be done after disconnect() | |
void | disconnect_logger () |
Disconnect log destinations from logger. | |
bool | suspend () |
Suspend the DTR which is in doing transfer in the delivery process. | |
bool | error () const |
Did an error happen? | |
bool | is_destined_for_pre_processor () const |
Returns true if this DTR is about to go into the pre-processor. | |
bool | is_destined_for_post_processor () const |
Returns true if this DTR is about to go into the post-processor. | |
bool | is_destined_for_delivery () const |
Returns true if this DTR is about to go into delivery. | |
bool | came_from_pre_processor () const |
Returns true if this DTR just came from the pre-processor. | |
bool | came_from_post_processor () const |
Returns true if this DTR just came from the post-processor. | |
bool | came_from_delivery () const |
Returns true if this DTR just came from delivery. | |
bool | came_from_generator () const |
Returns true if this DTR just came from the generator. | |
bool | is_in_final_state () const |
Returns true if this DTR is in a final state (finished, failed or cancelled) | |
Static Public Member Functions | |
static void | push (DTR_ptr dtr, StagingProcesses new_owner) |
Pass the DTR from one process to another. Protected by lock. | |
Static Public Attributes | |
static const Arc::URL | LOCAL_DELIVERY |
URL that is used to denote local Delivery should be used. | |
static Arc::LogLevel | LOG_LEVEL |
Log level for all DTR activity. | |
Data Transfer Request.
DTR stands for Data Transfer Request and a DTR describes a data transfer between two endpoints, a source and a destination. There are several parameters and options relating to the transfer contained in a DTR. The normal workflow is for a Generator to create a DTR and send it to the Scheduler for processing using DTR::push(SCHEDULER). If the Generator is a subclass of DTRCallback, when the Scheduler has finished with the DTR the DTRCallback::receiveDTR() callback method is called.
DTRs should always be used through the Arc::ThreadedPointer DTR_ptr. This ensures proper memory management when passing DTRs among various threads. To enforce this policy the copy constructor and assignment operator are private.
A lock protects member variables that are likely to be accessed and modified by multiple threads.
DataStaging::DTR::DTR | ( | const std::string & | source, |
const std::string & | destination, | ||
const Arc::UserConfig & | usercfg, | ||
const std::string & | jobid, | ||
const uid_t & | uid, | ||
DTRLogger | log | ||
) |
Normal constructor.
Construct a new DTR.
source | Endpoint from which to read data |
destination | Endpoint to which to write data |
usercfg | Provides some user configuration information |
jobid | ID of the job associated with this data transfer |
uid | UID to use when accessing local file system if source or destination is a local file. If this is different to the current uid then the current uid must have sufficient privileges to change uid. |
log | ThreadedPointer containing log object. If NULL the root logger is used. |
|
inline |
Add problematic endpoint.
Should only be those endpoints where there is a problem with the service itself and not the transfer.
void DataStaging::DTR::registerCallback | ( | DTRCallback * | cb, |
StagingProcesses | owner | ||
) |
Register callback objects to be used during DTR processing.
Objects deriving from DTRCallback can be registered with this method. The callback method of these objects will then be called when the DTR is passed to the specified owner. Protected by lock.
void DataStaging::DTR::reset | ( | ) |
void DataStaging::DTR::set_error_status | ( | DTRErrorStatus::DTRErrorStatusType | error_stat, |
DTRErrorStatus::DTRErrorLocation | error_loc, | ||
const std::string & | desc = "" |
||
) |
Set the error status.
The DTRErrorStatus last error state field is set to the current status of the DTR. Protected by lock.