|
xrootd
|
#include "XrdClient/XrdClientUrlInfo.hh"#include "XrdSys/XrdSysPthread.hh"#include "XrdClient/XrdClient.hh"#include "XrdClient/XrdCpMthrQueue.hh"#include "XrdClient/XrdClientDebug.hh"#include "XrdClient/XrdCpWorkLst.hh"#include "XrdClient/XrdClientEnv.hh"#include "XrdSys/XrdSysPlatform.hh"#include <XrdCrypto/XrdCryptoFactory.hh>#include <XrdCrypto/XrdCryptoMsgDigest.hh>#include "XrdClient/XrdClientAbsMonIntf.hh"#include "XrdClient/XrdcpXtremeRead.hh"#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/time.h>#include <unistd.h>#include <dlfcn.h>#include <stdarg.h>#include <stdio.h>
Classes | |
| struct | XrdCpInfo |
| struct | xtreme_threadnfo |
Defines | |
| #define | COUT(s) |
| #define | CERR(s) |
| #define | XRDCP_BLOCKSIZE (8*1024*1024) |
| #define | XRDCP_XRDRASIZE (30*XRDCP_BLOCKSIZE) |
| #define | XRDCP_VERSION "(C) 2004-2011 by the XRootD collaboration. Version: "XrdVSTRING |
| #define | LOC_WR_FLAGS_FORCE ( O_CREAT | O_WRONLY | O_TRUNC | O_BINARY ); |
| #define | LOC_WR_FLAGS ( O_CREAT | O_WRONLY | O_EXCL | O_BINARY ); |
Functions | |
| void | cout_print (const char *format,...) |
| void | cerr_print (const char *format,...) |
| void | print_summary (const char *src, const char *dst, unsigned long long bytesread, unsigned int adler) |
| void | print_progbar (unsigned long long bytesread, unsigned long long size) |
| void | print_chksum (const char *src, unsigned long long bytesread, unsigned adler) |
| void * | ReaderThread_xrd (void *) |
| void * | ReaderThread_xrd_xtreme (void *parm) |
| void * | ReaderThread_loc (void *) |
| int | CreateDestPath_loc (XrdOucString path, bool isdir) |
| void | BuildFullDestFilename (XrdOucString &src, XrdOucString &dest, bool destisdir) |
| int | CreateDestPath_xrd (XrdOucString url, bool isdir) |
| int | doCp_xrd2xrd (XrdClient **xrddest, const char *src, const char *dst) |
| XrdClient * | BWMToken_Init (const char *bwmhost, const char *srcurl, const char *dsturl) |
| bool | BWMToken_WaitFor (XrdClient *cli) |
| int | doCp_xrd2loc (const char *src, const char *dst) |
| int | doCp_loc2xrd (XrdClient **xrddest, const char *src, const char *dst) |
| void | PrintUsage () |
| int | main (int argc, char **argv) |
Variables | |
| const char * | XrdcpCVSID = "$Id$" |
| struct XrdCpInfo | cpnfo |
| bool | summary = false |
| bool | progbar = true |
| bool | md5 = false |
| bool | adlerchk = false |
| XrdOucString | monlibname = "libXrdCpMonitorClient.so" |
| char * | srcopaque = 0 |
| char * | dstopaque = 0 |
| kXR_unt16 | xrd_wr_flags = kXR_async | kXR_mkpath | kXR_open_updt | kXR_new |
| int | loc_wr_flags = LOC_WR_FLAGS |
| bool | recurse = false |
| char | BWMHost [1024] |
| bool | doXtremeCp = false |
| int | maxSources = 12 |
| XrdOucString | XtremeCpRdr |
| struct timeval | abs_start_time |
| struct timeval | abs_stop_time |
| struct timezone | tz |
| unsigned int | adler = 0 |
| #define CERR | ( | s | ) |
do { \ cerr_print s; \ } while (0)
Referenced by print_progbar().
| #define COUT | ( | s | ) |
do { \ cout_print s; \ } while (0)
Referenced by print_summary().
| #define LOC_WR_FLAGS ( O_CREAT | O_WRONLY | O_EXCL | O_BINARY ); |
| #define LOC_WR_FLAGS_FORCE ( O_CREAT | O_WRONLY | O_TRUNC | O_BINARY ); |
Referenced by main().
| #define XRDCP_BLOCKSIZE (8*1024*1024) |
Referenced by ReaderThread_xrd(), ReaderThread_xrd_xtreme(), ReaderThread_loc(), doCp_xrd2xrd(), and doCp_xrd2loc().
| #define XRDCP_VERSION "(C) 2004-2011 by the XRootD collaboration. Version: "XrdVSTRING |
Referenced by main().
| #define XRDCP_XRDRASIZE (30*XRDCP_BLOCKSIZE) |
Referenced by main().
| void BuildFullDestFilename | ( | XrdOucString & | src, |
| XrdOucString & | dest, | ||
| bool | destisdir | ||
| ) |
References XrdOucString::erase(), XrdOucString::find(), XrdOucString::rfind(), and STR_NPOS.
Referenced by main().
| XrdClient* BWMToken_Init | ( | const char * | bwmhost, |
| const char * | srcurl, | ||
| const char * | dsturl | ||
| ) |
References XrdClientUrlInfo::File, XrdClientUrlInfo::Host, XrdOucString::c_str(), XrdClient::Open(), and kXR_open_updt.
Referenced by doCp_xrd2loc().
| bool BWMToken_WaitFor | ( | XrdClient * | cli | ) |
References XrdClient::IsOpen(), XrdClientAbs::Query(), and kXR_Qvisa.
Referenced by doCp_xrd2loc().
| void cerr_print | ( | const char * | format, |
| ... | |||
| ) |
| void cout_print | ( | const char * | format, |
| ... | |||
| ) |
| int CreateDestPath_loc | ( | XrdOucString | path, |
| bool | isdir | ||
| ) |
References XrdOucString::rfind(), STR_NPOS, XrdOucString::erase(), MAKEDIR, XrdOucString::c_str(), S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, and S_IXOTH.
Referenced by main().
| int CreateDestPath_xrd | ( | XrdOucString | url, |
| bool | isdir | ||
| ) |
References FALSE, TRUE, XrdOucString::erase(), XrdOucString::rfind(), XrdOucString::c_str(), XrdClientAdmin::Connect(), XrdClientAdmin::Stat(), XrdClientUrlInfo::File, XrdClientAbs::GetCurrentUrl(), XrdClientUrlInfo::IsValid(), XrdClientUrlInfo::Host, XrdClientUrlInfo::Port, XrdClientUrlInfo::GetUrl(), kXR_isDir, kXR_xset, kXR_other, Info, XrdClientDebug::kHIDEBUG, and XrdClientAdmin::Mkdir().
| int doCp_loc2xrd | ( | XrdClient ** | xrddest, |
| const char * | src, | ||
| const char * | dst | ||
| ) |
References stat(), gettimeofday(), abs_start_time, tz, cpnfo, XrdCpInfo::localfile, open(), O_BINARY, fstat(), AddSizeHint(), XrdOucString::c_str(), PedanticOpen4Write(), kXR_ur, kXR_uw, kXR_gw, kXR_gr, kXR_or, xrd_wr_flags, PrintLastServerError(), close, XrdSysThread::Run(), ReaderThread_loc(), XRDSYSTHREAD_HOLD, progbar, abs_stop_time, print_progbar(), md5, adlerchk, print_chksum(), summary, and print_summary().
Referenced by main().
| int doCp_xrd2loc | ( | const char * | src, |
| const char * | dst | ||
| ) |
References stat(), BWMHost, BWMToken_Init(), BWMToken_WaitFor(), XrdClientUrlInfo::Host, XrdOucString::c_str(), gettimeofday(), abs_start_time, tz, cpnfo, XrdCpInfo::XrdCli, XrdClient::Open(), kXR_async, XrdClientAbs::LastServerResp(), ServerResponseHeader::status, kXR_ok, PrintLastServerError(), XrdClient::Stat(), XrdCpInfo::len, XrdClientStatInfo::size, open(), loc_wr_flags, S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, XrdClient::Close(), STDOUT_FILENO, doXtremeCp, XrdXtRdFile::GetListOfSources(), maxSources, XrdClientVector::GetSize(), XRDCP_BLOCKSIZE, xtreme_threadnfo::xtrdhandler, xtreme_threadnfo::cli, xtreme_threadnfo::clientidx, XrdXtRdFile::GimmeANewClientIdx(), xtreme_threadnfo::startfromblk, XrdXtRdFile::GetNBlks(), xtreme_threadnfo::maxoutstanding, xrdmax, xrdmin, XrdSysThread::Run(), ReaderThread_xrd_xtreme(), XRDSYSTHREAD_HOLD, XrdClientVector::Push_back(), ReaderThread_xrd(), XrdXtRdFile::AllDone(), XrdCpInfo::queue, XrdCpMthrQueue::GetLength(), XrdCpMthrQueue::GetBuffer(), progbar, abs_stop_time, print_progbar(), md5, adlerchk, lseek(), write(), XrdCpInfo::mon, XrdClientAbsMonIntf::PutProgressInfo(), print_chksum(), summary, print_summary(), and close.
Referenced by main().
| int doCp_xrd2xrd | ( | XrdClient ** | xrddest, |
| const char * | src, | ||
| const char * | dst | ||
| ) |
References stat(), gettimeofday(), abs_start_time, tz, cpnfo, XrdCpInfo::XrdCli, XrdClient::Open(), kXR_async, XrdClientAbs::LastServerResp(), ServerResponseHeader::status, kXR_ok, PrintLastServerError(), XrdClient::Stat(), XrdCpInfo::len, XrdClientStatInfo::size, AddSizeHint(), XrdOucString::c_str(), PedanticOpen4Write(), kXR_ur, kXR_uw, kXR_gw, kXR_gr, kXR_or, xrd_wr_flags, doXtremeCp, XrdXtRdFile::GetListOfSources(), maxSources, XrdClientVector::GetSize(), XRDCP_BLOCKSIZE, xtreme_threadnfo::xtrdhandler, xtreme_threadnfo::cli, xtreme_threadnfo::clientidx, XrdXtRdFile::GimmeANewClientIdx(), xtreme_threadnfo::startfromblk, XrdXtRdFile::GetNBlks(), xtreme_threadnfo::maxoutstanding, xrdmin, XrdSysThread::Run(), ReaderThread_xrd_xtreme(), XRDSYSTHREAD_HOLD, XrdClientVector::Push_back(), ReaderThread_xrd(), XrdXtRdFile::AllDone(), XrdCpInfo::queue, XrdCpMthrQueue::GetLength(), XrdCpMthrQueue::GetBuffer(), progbar, abs_stop_time, print_progbar(), md5, adlerchk, XrdCpInfo::mon, XrdClientAbsMonIntf::PutProgressInfo(), print_chksum(), summary, and print_summary().
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
References BWMHost, XRDCP_VERSION, PrintUsage(), DebugSetLevel, EnvPutString, NAME_REDIRDOMAINALLOW_RE, NAME_CONNECTDOMAINALLOW_RE, NAME_REDIRDOMAINDENY_RE, NAME_CONNECTDOMAINDENY_RE, EnvPutInt, NAME_READAHEADSIZE, XRDCP_XRDRASIZE, NAME_READCACHESIZE, NAME_READCACHEBLKREMPOLICY, XrdClientReadCache::kRmBlk_LeastOffs, NAME_PURGEWRITTENBLOCKS, NAME_DEBUG, summary, progbar, recurse, srcopaque, dstopaque, xrd_wr_flags, kXR_force, kXR_posc, kXR_new, kXR_delete, loc_wr_flags, LOC_WR_FLAGS_FORCE, NAME_CONNECTTIMEOUT, NAME_FIRSTCONNECTMAXCNT, EnvGetString, EnvGetLong, XrdMonCtrCollector::port, NAME_SOCKS4HOST, NAME_SOCKS4PORT, dbglvl, xrdmin, xrdmax, NAME_MULTISTREAMCNT, doXtremeCp, maxSources, md5, XrdCryptoFactory::GetCryptoFactory(), XrdCryptoFactory::MsgDigest(), adlerchk, XtremeCpRdr, Info, XrdClientDebug::kUSERDEBUG, cpnfo, XrdCpInfo::XrdCli, XrdCpWorkLst::SetSrc(), XrdCpWorkLst::SetDest(), PrintLastServerError(), XrdCpWorkLst::GetCpJob(), XrdCpInfo::mon, dlopen(), XrdOucString::c_str(), dlsym(), dlerror(), dlclose(), XrdClientAbsMonIntf::GetMonLibInfo(), XrdClientAbsMonIntf::Init(), DebugLevel, XrdClientAbsMonIntf::PutProgressInfo(), XrdCpInfo::len, XrdOucString::beginswith(), XrdCpWorkLst::GetDest(), BuildFullDestFilename(), doCp_xrd2xrd(), CreateDestPath_loc(), doCp_xrd2loc(), doCp_loc2xrd(), and XrdClientAbsMonIntf::DeInit().
| void print_chksum | ( | const char * | src, |
| unsigned long long | bytesread, | ||
| unsigned | adler | ||
| ) |
References adlerchk, XrdOucString::erase(), XrdOucString::rfind(), and XrdCryptoBasic::AsHexString().
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| void print_progbar | ( | unsigned long long | bytesread, |
| unsigned long long | size | ||
| ) |
References CERR, abs_stop_time, and abs_start_time.
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| void print_summary | ( | const char * | src, |
| const char * | dst, | ||
| unsigned long long | bytesread, | ||
| unsigned int | adler | ||
| ) |
References gettimeofday(), abs_stop_time, tz, abs_start_time, XrdOucString::erase(), XrdOucString::rfind(), COUT, XrdOucString::c_str(), md5, XrdCryptoBasic::AsHexString(), and adlerchk.
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| void PrintUsage | ( | ) |
| void* ReaderThread_loc | ( | void * | ) |
References Info, XrdClientDebug::kHIDEBUG, XRDCP_BLOCKSIZE, read(), cpnfo, XrdCpInfo::localfile, XrdCpInfo::queue, XrdCpMthrQueue::PutBuffer(), and XrdCpInfo::bread.
Referenced by doCp_loc2xrd().
| void* ReaderThread_xrd | ( | void * | ) |
References Info, XrdClientDebug::kHIDEBUG, cpnfo, XrdCpInfo::len, XRDCP_BLOCKSIZE, xrdmin, XrdCpInfo::XrdCli, XrdClient::Read(), XrdCpInfo::queue, XrdCpMthrQueue::PutBuffer(), XrdClient::RemoveDataFromCache(), and XrdCpInfo::bread.
Referenced by doCp_xrd2xrd(), and doCp_xrd2loc().
| void* ReaderThread_xrd_xtreme | ( | void * | parm | ) |
References Info, XrdClientDebug::kHIDEBUG, xtreme_threadnfo::startfromblk, xtreme_threadnfo::cli, XrdClient::Open(), XrdClient::SetCacheParameters(), XRDCP_BLOCKSIZE, xtreme_threadnfo::maxoutstanding, XrdClientReadCache::kRmBlk_FIFO, XrdClient::IsOpen_wait(), xtreme_threadnfo::xtrdhandler, XrdXtRdFile::GetBlkToPrefetch(), xtreme_threadnfo::clientidx, XrdClient::Read_Async(), XrdXtRdBlkInfo::offs, XrdXtRdBlkInfo::len, kOK, XrdXtRdFile::GetBlkToRead(), XrdClient::Read(), XrdXtRdFile::MarkBlkAsRead(), cpnfo, XrdCpInfo::queue, XrdCpMthrQueue::PutBuffer(), xrdmin, sleep, XrdClient::RemoveDataFromCache(), and XrdXtRdFile::AllDone().
Referenced by doCp_xrd2xrd(), and doCp_xrd2loc().
| struct timeval abs_start_time |
Referenced by print_summary(), print_progbar(), doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| struct timeval abs_stop_time |
Referenced by print_summary(), print_progbar(), doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| bool adlerchk = false |
Referenced by print_summary(), print_chksum(), doCp_xrd2xrd(), doCp_xrd2loc(), doCp_loc2xrd(), and main().
| char BWMHost[1024] |
Referenced by doCp_xrd2loc(), and main().
Referenced by ReaderThread_xrd(), ReaderThread_xrd_xtreme(), ReaderThread_loc(), doCp_xrd2xrd(), doCp_xrd2loc(), doCp_loc2xrd(), and main().
| bool doXtremeCp = false |
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), and main().
| int loc_wr_flags = LOC_WR_FLAGS |
Referenced by doCp_xrd2loc(), and main().
| int maxSources = 12 |
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), main(), and XrdXtRdFile::GetListOfSources().
| bool md5 = false |
Referenced by print_summary(), doCp_xrd2xrd(), doCp_xrd2loc(), doCp_loc2xrd(), and main().
| XrdOucString monlibname = "libXrdCpMonitorClient.so" |
| bool progbar = true |
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), doCp_loc2xrd(), and main().
| bool summary = false |
Referenced by doCp_xrd2xrd(), doCp_xrd2loc(), doCp_loc2xrd(), and main().
Referenced by print_summary(), doCp_xrd2xrd(), doCp_xrd2loc(), and doCp_loc2xrd().
| kXR_unt16 xrd_wr_flags = kXR_async | kXR_mkpath | kXR_open_updt | kXR_new |
| const char* XrdcpCVSID = "$Id$" |
Referenced by main().
1.7.5