35using namespace std::string_literals;
51 PlugInProgressHandler( uint32_t job_id,
52 CopyProgressHandler &progress ):
58 void HandleProgress( std::size_t processed,
59 std::size_t total )
override
64 progress.JobProgress( job_id, processed, this->total );
68 CopyProgressHandler &progress;
69 const uint32_t job_id;
70 std::size_t total = 0;
80 CopyJob( jobId, jobProperties, jobResults )
84 "from %s to %s",
GetSource().GetObfuscatedURL().c_str(),
101 const bool tpcFallBack =
pProperties->
Get<std::string>(
"thirdParty" ) ==
"first"s;
104 if( st.IsOK() )
return st;
109 std::optional<PlugInProgressHandler> progress_handler;
111 progress_handler.emplace(
pJobId, *progress );
114 progress_handler ? &progress_handler.value() :
nullptr);
123 log->
Debug(
UtilityMsg,
"TPC is not supported, falling back to streaming mode." );
ClassicCopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
CopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
const URL & GetSource() const
Get source.
const URL & GetTarget() const
Get target.
PropertyList * pProperties
Interface for copy progress notification.
static Log * GetLog()
Get default log.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Handle the progress of an asynchronous operation.
A key-value pair map storing both keys and values as strings.
bool Get(const std::string &name, Item &item) const
virtual ~TPFallBackCopyJob()
Destructor.
virtual XRootDStatus Run(CopyProgressHandler *progress=0)
TPFallBackCopyJob(uint32_t jobId, PropertyList *jobProperties, PropertyList *jobResults)
Constructor.
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 uint64_t UtilityMsg
const uint16_t errNotSupported