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 77 of file XrdClTPFallBackCopyJob.cc.

79 :
80 CopyJob( jobId, jobProperties, jobResults )
81 {
82 Log *log = DefaultEnv::GetLog();
83 log->Debug( UtilityMsg, "Creating a third party fall back copy job, "
84 "from %s to %s", GetSource().GetObfuscatedURL().c_str(),
85 GetTarget().GetObfuscatedURL().c_str() );
86 }
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.

Referenced by XrdCl::CopyProcess::Prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~TPFallBackCopyJob()

XrdCl::TPFallBackCopyJob::~TPFallBackCopyJob ( )
virtualdefault

Destructor.

References Run().

Here is the call graph for this function:

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 96 of file XrdClTPFallBackCopyJob.cc.

97 {
98 //--------------------------------------------------------------------------
99 // Set up the job
100 //--------------------------------------------------------------------------
101 const bool tpcFallBack = pProperties->Get<std::string>( "thirdParty" ) == "first"s;
102
103 XRootDStatus st = ThirdPartyCopyJob(pJobId, pProperties, pResults).Run(progress);
104 if( st.IsOK() ) return st; // we are done
105
106 // try with the plugins
107 if (st.code == errNotSupported)
108 {
109 std::optional<PlugInProgressHandler> progress_handler;
110 if( progress )
111 progress_handler.emplace( pJobId, *progress );
112
114 progress_handler ? &progress_handler.value() : nullptr);
115 if (st.IsOK())
116 return st;
117 }
118
119 // check if we can fall back to streaming
120 if( tpcFallBack && ( st.code == errNotSupported || st.code == errNotImplemented || st.code == errOperationExpired ) )
121 {
122 Log *log = DefaultEnv::GetLog();
123 log->Debug( UtilityMsg, "TPC is not supported, falling back to streaming mode." );
124
125 return ClassicCopyJob(pJobId, pProperties, pResults).Run(progress);
126 }
127
128 return st;
129 }
ClassicCopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
PropertyList * pResults
PropertyList * pProperties
bool Get(const std::string &name, Item &item) const
ThirdPartyCopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
const uint16_t errOperationExpired
const uint16_t errNotImplemented
Operation is not implemented.
XRootDStatus ThirdPartyCopy(const URL &source, const URL &dest, const PropertyList *properties, ProgressHandler *progress_handler, time_t timeout)
const uint16_t errNotSupported

References XrdCl::ClassicCopyJob::ClassicCopyJob(), XrdCl::ThirdPartyCopyJob::ThirdPartyCopyJob(), XrdCl::Log::Debug(), XrdCl::errNotImplemented, XrdCl::errNotSupported, XrdCl::errOperationExpired, XrdCl::PropertyList::Get(), XrdCl::DefaultEnv::GetLog(), XrdCl::CopyJob::GetSource(), XrdCl::CopyJob::GetTarget(), XrdCl::CopyJob::pJobId, XrdCl::CopyJob::pProperties, XrdCl::CopyJob::pResults, XrdCl::ThirdPartyCopy(), and XrdCl::UtilityMsg.

Referenced by ~TPFallBackCopyJob().

Here is the call graph for this function:
Here is the caller graph for this function:

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