XRootD
XrdCl::TPFallBackCopyJob Class Reference

#include <XrdClTPFallBackCopyJob.hh>

+ Inheritance diagram for XrdCl::TPFallBackCopyJob:
+ Collaboration diagram for XrdCl::TPFallBackCopyJob:

Public Member Functions

 TPFallBackCopyJob (uint16_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
 Constructor. More...
 
virtual ~TPFallBackCopyJob ()
 Destructor. More...
 
virtual XRootDStatus Run (CopyProgressHandler *progress=0)
 
- Public Member Functions inherited from XrdCl::CopyJob
 CopyJob (uint16_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
 Constructor. More...
 
virtual ~CopyJob ()
 Virtual destructor. More...
 
PropertyListGetProperties ()
 Get the job properties. More...
 
PropertyListGetResults ()
 Get the job results. More...
 
const URLGetSource () const
 Get source. More...
 
const URLGetTarget () const
 Get target. More...
 
void Init ()
 

Additional Inherited Members

- Protected Attributes inherited from XrdCl::CopyJob
uint16_t pJobId
 
PropertyListpProperties
 
PropertyListpResults
 
URL pSource
 
URL pTarget
 

Detailed Description

Definition at line 33 of file XrdClTPFallBackCopyJob.hh.

Constructor & Destructor Documentation

◆ TPFallBackCopyJob()

XrdCl::TPFallBackCopyJob::TPFallBackCopyJob ( uint16_t  jobId,
PropertyList jobProperties,
PropertyList jobResults 
)

Constructor.

Definition at line 38 of file XrdClTPFallBackCopyJob.cc.

40  :
41  CopyJob( jobId, jobProperties, jobResults ),
42  pJob( 0 )
43  {
44  Log *log = DefaultEnv::GetLog();
45  log->Debug( UtilityMsg, "Creating a third party fall back copy job, "
46  "from %s to %s", GetSource().GetObfuscatedURL().c_str(),
47  GetTarget().GetObfuscatedURL().c_str() );
48  }
const URL & GetSource() const
Get source.
Definition: XrdClCopyJob.hh:94
const URL & GetTarget() const
Get target.
CopyJob(uint16_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
Definition: XrdClCopyJob.hh:41
static Log * GetLog()
Get default log.
const uint64_t UtilityMsg
XrdSysError Log
Definition: XrdConfig.cc:112

References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::CopyJob::GetSource(), XrdCl::CopyJob::GetTarget(), and XrdCl::UtilityMsg.

+ Here is the call graph for this function:

◆ ~TPFallBackCopyJob()

XrdCl::TPFallBackCopyJob::~TPFallBackCopyJob ( )
virtual

Destructor.

Definition at line 53 of file XrdClTPFallBackCopyJob.cc.

54  {
55  delete pJob;
56  }

Member Function Documentation

◆ Run()

XRootDStatus XrdCl::TPFallBackCopyJob::Run ( CopyProgressHandler progress = 0)
virtual

Run the copy job

Parameters
progressthe handler to be notified about the copy progress
Returns
status of the copy operation

Implements XrdCl::CopyJob.

Definition at line 61 of file XrdClTPFallBackCopyJob.cc.

62  {
63  //--------------------------------------------------------------------------
64  // Set up the job
65  //--------------------------------------------------------------------------
66  std::string tmp;
67  bool tpcFallBack = false;
68 
69  pProperties->Get( "thirdParty", tmp );
70  if( tmp == "first" )
71  tpcFallBack = true;
72 
73  pJob = new ThirdPartyCopyJob( pJobId, pProperties, pResults );
74  XRootDStatus st = pJob->Run( progress );
75  if( st.IsOK() ) return st; // we are done
76 
77  // check if we can fall back to streaming
78  if( tpcFallBack && ( st.code == errNotSupported || st.code == errOperationExpired ) )
79  {
80  Log *log = DefaultEnv::GetLog();
81  log->Debug( UtilityMsg, "TPC is not supported, falling back to streaming mode." );
82 
83  delete pJob;
84  pJob = new ClassicCopyJob( pJobId, pProperties, pResults );
85  return pJob->Run( progress );
86  }
87 
88  return st;
89  }
PropertyList * pResults
virtual XRootDStatus Run(CopyProgressHandler *progress=0)=0
PropertyList * pProperties
bool Get(const std::string &name, Item &item) const
const uint16_t errOperationExpired
Definition: XrdClStatus.hh:90
const uint16_t errNotSupported
Definition: XrdClStatus.hh:62

References XrdCl::Status::code, XrdCl::Log::Debug(), XrdCl::errNotSupported, XrdCl::errOperationExpired, XrdCl::PropertyList::Get(), XrdCl::DefaultEnv::GetLog(), XrdCl::Status::IsOK(), XrdCl::CopyJob::pJobId, XrdCl::CopyJob::pProperties, XrdCl::CopyJob::pResults, XrdCl::CopyJob::Run(), and XrdCl::UtilityMsg.

+ Here is the call graph for this function:

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