XRootD
Loading...
Searching...
No Matches
XrdCl::TPFallBackCopyJob Class Reference

#include <XrdClTPFallBackCopyJob.hh>

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

Public Member Functions

 TPFallBackCopyJob (uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
 Constructor.
virtual ~TPFallBackCopyJob ()
 Destructor.
virtual XRootDStatus Run (CopyProgressHandler *progress=0)
Public Member Functions inherited from XrdCl::CopyJob
 CopyJob (uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
 Constructor.
virtual ~CopyJob ()
 Virtual destructor.
PropertyList * GetProperties ()
 Get the job properties.
PropertyList * GetResults ()
 Get the job results.
const URL & GetSource () const
 Get source.
const URL & GetTarget () const
 Get target.
void Init ()

Additional Inherited Members

Protected Attributes inherited from XrdCl::CopyJob
uint32_t pJobId
PropertyList * pProperties
PropertyList * pResults
URL pSource
URL pTarget

Detailed Description

Definition at line 33 of file XrdClTPFallBackCopyJob.hh.

Constructor & Destructor Documentation

◆ TPFallBackCopyJob()

XrdCl::TPFallBackCopyJob::TPFallBackCopyJob ( uint32_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 }
CopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
const URL & GetSource() const
Get source.
const URL & GetTarget() const
Get target.
static Log * GetLog()
Get default log.
const uint64_t UtilityMsg
XrdSysError Log
Definition XrdConfig.cc:113

References XrdCl::CopyJob::CopyJob(), 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
PropertyList * pProperties
const uint16_t errOperationExpired
const uint16_t errNotSupported

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

Here is the call graph for this function:

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