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-2010 by the Xrootd group. $Revision$ - Xrootd 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 |
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 doCp_xrd2loc(), doCp_xrd2xrd(), ReaderThread_loc(), ReaderThread_xrd(), and ReaderThread_xrd_xtreme().
#define XRDCP_VERSION "(C) 2004-2010 by the Xrootd group. $Revision$ - Xrootd 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 XrdOucString::c_str(), XrdClientUrlInfo::File, XrdClientUrlInfo::Host, kXR_open_updt, and XrdClient::Open().
Referenced by doCp_xrd2loc().
bool BWMToken_WaitFor | ( | XrdClient * | cli | ) |
References XrdClient::IsOpen(), kXR_Qvisa, and XrdClientAbs::Query().
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::c_str(), XrdOucString::erase(), MAKEDIR, XrdOucString::rfind(), S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR, and STR_NPOS.
Referenced by main().
int CreateDestPath_xrd | ( | XrdOucString | url, |
bool | isdir | ||
) |
References XrdOucString::c_str(), XrdClientAdmin::Connect(), XrdOucString::erase(), FALSE, XrdClientUrlInfo::File, XrdClientAbs::GetCurrentUrl(), XrdClientUrlInfo::GetUrl(), XrdClientUrlInfo::Host, Info, XrdClientUrlInfo::IsValid(), XrdClientDebug::kHIDEBUG, kXR_isDir, kXR_other, kXR_xset, XrdClientAdmin::Mkdir(), XrdClientUrlInfo::Port, XrdOucString::rfind(), XrdClientAdmin::Stat(), and TRUE.
int doCp_loc2xrd | ( | XrdClient ** | xrddest, |
const char * | src, | ||
const char * | dst | ||
) |
References abs_start_time, abs_stop_time, adlerchk, close, cpnfo, fstat(), gettimeofday(), kXR_gr, kXR_gw, kXR_or, kXR_ur, kXR_uw, XrdCpInfo::localfile, md5, O_BINARY, open(), PedanticOpen4Write(), print_chksum(), print_progbar(), print_summary(), PrintLastServerError(), progbar, ReaderThread_loc(), XrdSysThread::Run(), stat(), summary, tz, and xrd_wr_flags.
Referenced by main().
int doCp_xrd2loc | ( | const char * | src, |
const char * | dst | ||
) |
References abs_start_time, abs_stop_time, adlerchk, XrdXtRdFile::AllDone(), BWMHost, BWMToken_Init(), BWMToken_WaitFor(), XrdOucString::c_str(), xtreme_threadnfo::cli, xtreme_threadnfo::clientidx, close, XrdClient::Close(), cpnfo, doXtremeCp, XrdCpMthrQueue::GetBuffer(), XrdCpMthrQueue::GetLength(), XrdXtRdFile::GetListOfSources(), XrdXtRdFile::GetNBlks(), XrdClientVector< T >::GetSize(), gettimeofday(), XrdXtRdFile::GimmeANewClientIdx(), XrdClientUrlInfo::Host, kXR_async, kXR_ok, XrdClientAbs::LastServerResp(), XrdCpInfo::len, loc_wr_flags, lseek(), xtreme_threadnfo::maxoutstanding, md5, XrdCpInfo::mon, open(), XrdClient::Open(), print_chksum(), print_progbar(), print_summary(), PrintLastServerError(), progbar, XrdClientAbsMonIntf::PutProgressInfo(), XrdCpInfo::queue, ReaderThread_xrd(), ReaderThread_xrd_xtreme(), XrdSysThread::Run(), S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWUSR, XrdClientStatInfo::size, xtreme_threadnfo::startfromblk, XrdClient::Stat(), stat(), ServerResponseHeader::status, STDOUT_FILENO, summary, tz, write(), XrdCpInfo::XrdCli, XRDCP_BLOCKSIZE, xrdmax, xrdmin, and xtreme_threadnfo::xtrdhandler.
Referenced by main().
int doCp_xrd2xrd | ( | XrdClient ** | xrddest, |
const char * | src, | ||
const char * | dst | ||
) |
References abs_start_time, abs_stop_time, adlerchk, XrdXtRdFile::AllDone(), xtreme_threadnfo::cli, xtreme_threadnfo::clientidx, cpnfo, doXtremeCp, XrdCpMthrQueue::GetBuffer(), XrdCpMthrQueue::GetLength(), XrdXtRdFile::GetListOfSources(), XrdXtRdFile::GetNBlks(), XrdClientVector< T >::GetSize(), gettimeofday(), XrdXtRdFile::GimmeANewClientIdx(), kXR_async, kXR_gr, kXR_gw, kXR_ok, kXR_or, kXR_ur, kXR_uw, XrdClientAbs::LastServerResp(), XrdCpInfo::len, xtreme_threadnfo::maxoutstanding, md5, XrdCpInfo::mon, XrdClient::Open(), PedanticOpen4Write(), print_chksum(), print_progbar(), print_summary(), PrintLastServerError(), progbar, XrdClientVector< T >::Push_back(), XrdClientAbsMonIntf::PutProgressInfo(), XrdCpInfo::queue, ReaderThread_xrd(), ReaderThread_xrd_xtreme(), XrdSysThread::Run(), XrdClientStatInfo::size, xtreme_threadnfo::startfromblk, XrdClient::Stat(), stat(), ServerResponseHeader::status, summary, tz, xrd_wr_flags, XrdCpInfo::XrdCli, XRDCP_BLOCKSIZE, xrdmin, and xtreme_threadnfo::xtrdhandler.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
References adlerchk, XrdOucString::beginswith(), BuildFullDestFilename(), BWMHost, XrdOucString::c_str(), cpnfo, CreateDestPath_loc(), dbglvl, DebugLevel, DebugSetLevel, XrdClientAbsMonIntf::DeInit(), dlclose(), dlerror(), dlopen(), dlsym(), doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), doXtremeCp, dstopaque, EnvGetLong, EnvGetString, EnvPutInt, EnvPutString, XrdCpWorkLst::GetCpJob(), XrdCryptoFactory::GetCryptoFactory(), XrdCpWorkLst::GetDest(), XrdClientAbsMonIntf::GetMonLibInfo(), Info, XrdClientAbsMonIntf::Init(), XrdClientReadCache::kRmBlk_LeastOffs, XrdClientDebug::kUSERDEBUG, kXR_delete, kXR_force, kXR_new, kXR_posc, XrdCpInfo::len, loc_wr_flags, LOC_WR_FLAGS_FORCE, md5, XrdCpInfo::mon, XrdCryptoFactory::MsgDigest(), NAME_CONNECTDOMAINALLOW_RE, NAME_CONNECTDOMAINDENY_RE, NAME_CONNECTTIMEOUT, NAME_DEBUG, NAME_FIRSTCONNECTMAXCNT, NAME_MULTISTREAMCNT, NAME_PURGEWRITTENBLOCKS, NAME_READAHEADSIZE, NAME_READCACHEBLKREMPOLICY, NAME_READCACHESIZE, NAME_REDIRDOMAINALLOW_RE, NAME_REDIRDOMAINDENY_RE, NAME_SOCKS4HOST, NAME_SOCKS4PORT, XrdMonCtrCollector::port, PrintLastServerError(), PrintUsage(), progbar, XrdClientAbsMonIntf::PutProgressInfo(), recurse, XrdCpWorkLst::SetDest(), XrdCpWorkLst::SetSrc(), srcopaque, summary, xrd_wr_flags, XrdCpInfo::XrdCli, XRDCP_VERSION, XRDCP_XRDRASIZE, xrdmax, and xrdmin.
void print_chksum | ( | const char * | src, |
unsigned long long | bytesread, | ||
unsigned | adler | ||
) |
References adlerchk, XrdCryptoBasic::AsHexString(), XrdOucString::erase(), and XrdOucString::rfind().
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), and doCp_xrd2xrd().
void print_progbar | ( | unsigned long long | bytesread, |
unsigned long long | size | ||
) |
References abs_start_time, abs_stop_time, and CERR.
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), and doCp_xrd2xrd().
void print_summary | ( | const char * | src, |
const char * | dst, | ||
unsigned long long | bytesread, | ||
unsigned int | adler | ||
) |
References abs_start_time, abs_stop_time, adlerchk, XrdCryptoBasic::AsHexString(), XrdOucString::c_str(), COUT, XrdOucString::erase(), gettimeofday(), md5, XrdOucString::rfind(), and tz.
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), and main().
void PrintUsage | ( | ) |
void* ReaderThread_loc | ( | void * | ) |
References XrdCpInfo::bread, cpnfo, Info, XrdClientDebug::kHIDEBUG, XrdCpInfo::localfile, XrdCpMthrQueue::PutBuffer(), XrdCpInfo::queue, read(), and XRDCP_BLOCKSIZE.
Referenced by doCp_loc2xrd().
void* ReaderThread_xrd | ( | void * | ) |
References XrdCpInfo::bread, cpnfo, Info, XrdClientDebug::kHIDEBUG, XrdCpInfo::len, XrdCpMthrQueue::PutBuffer(), XrdCpInfo::queue, XrdClient::Read(), XrdClient::RemoveDataFromCache(), XrdCpInfo::XrdCli, XRDCP_BLOCKSIZE, and xrdmin.
Referenced by doCp_xrd2loc(), and doCp_xrd2xrd().
void* ReaderThread_xrd_xtreme | ( | void * | parm | ) |
References XrdXtRdFile::AllDone(), xtreme_threadnfo::cli, xtreme_threadnfo::clientidx, cpnfo, XrdXtRdFile::GetBlkToPrefetch(), XrdXtRdFile::GetBlkToRead(), Info, XrdClient::IsOpen_wait(), XrdClientDebug::kHIDEBUG, kOK, XrdClientReadCache::kRmBlk_FIFO, XrdXtRdBlkInfo::len, XrdXtRdFile::MarkBlkAsRead(), xtreme_threadnfo::maxoutstanding, XrdXtRdBlkInfo::offs, XrdClient::Open(), XrdCpMthrQueue::PutBuffer(), XrdCpInfo::queue, XrdClient::Read(), XrdClient::Read_Async(), XrdClient::RemoveDataFromCache(), XrdClient::SetCacheParameters(), sleep, xtreme_threadnfo::startfromblk, XRDCP_BLOCKSIZE, xrdmin, and xtreme_threadnfo::xtrdhandler.
Referenced by doCp_xrd2loc(), and doCp_xrd2xrd().
struct timeval abs_start_time |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), main(), print_progbar(), and print_summary().
struct timeval abs_stop_time |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), print_progbar(), and print_summary().
bool adlerchk = false |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), main(), print_chksum(), and print_summary().
char BWMHost[1024] |
Referenced by doCp_xrd2loc(), and main().
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), main(), ReaderThread_loc(), ReaderThread_xrd(), and ReaderThread_xrd_xtreme().
bool doXtremeCp = false |
Referenced by doCp_xrd2loc(), doCp_xrd2xrd(), and main().
int loc_wr_flags = LOC_WR_FLAGS |
Referenced by doCp_xrd2loc(), and main().
bool md5 = false |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), main(), and print_summary().
XrdOucString monlibname = "libXrdCpMonitorClient.so" |
bool progbar = true |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), and main().
bool summary = false |
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), and main().
Referenced by doCp_loc2xrd(), doCp_xrd2loc(), doCp_xrd2xrd(), main(), and print_summary().
kXR_unt16 xrd_wr_flags = kXR_async | kXR_mkpath | kXR_open_updt | kXR_new |
const char* XrdcpCVSID = "$Id$" |