![]() |
XRootD
|
#include <XrdClXCpCtx.hh>
Public Member Functions | |
XCpCtx (const std::vector< std::string > &urls, uint64_t blockSize, uint8_t parallelSrc, uint64_t chunkSize, uint64_t parallelChunks, int64_t fileSize) | |
bool | AllDone () |
void | Delete () |
std::pair< uint64_t, uint64_t > | GetBlock () |
XRootDStatus | GetChunk (XrdCl::PageInfo &ci) |
bool | GetNextUrl (std::string &url) |
int64_t | GetSize () |
XRootDStatus | Initialize () |
void | NotifyIdleSrc () |
void | NotifyInitExpectant () |
void | PutChunk (PageInfo *chunk) |
void | RemoveSrc (XCpSrc *src) |
XCpCtx * | Self () |
void | SetFileSize (int64_t size) |
XCpSrc * | WeakestLink (XCpSrc *exclude) |
Definition at line 40 of file XrdClXCpCtx.hh.
XrdCl::XCpCtx::XCpCtx | ( | const std::vector< std::string > & | urls, |
uint64_t | blockSize, | ||
uint8_t | parallelSrc, | ||
uint64_t | chunkSize, | ||
uint64_t | parallelChunks, | ||
int64_t | fileSize | ||
) |
Constructor
urls | : list of replica urls |
blockSize | : the default block size |
parallelSrc | : maximum number of parallel sources |
chunkSize | : the default chunk size |
parallelChunks | : the default number of parallel chunks per source |
fileSize | : the file size if specified in the metalink file (-1 indicates that the file size is not known and a stat should be done) |
Definition at line 36 of file XrdClXCpCtx.cc.
References SetFileSize().
bool XrdCl::XCpCtx::AllDone | ( | ) |
Returns true if all chunks have been transferred, otherwise blocks until NotifyIdleSrc is called, or a 1 minute timeout occurs.
Definition at line 177 of file XrdClXCpCtx.cc.
References XrdSysCondVar::Wait().
|
inline |
Deletes the instance if the reference counter reached 0.
Definition at line 61 of file XrdClXCpCtx.hh.
References XrdSysMutexHelper::UnLock().
Referenced by XrdCl::XCpSrc::Start().
std::pair< uint64_t, uint64_t > XrdCl::XCpCtx::GetBlock | ( | ) |
Get next block that has to be transferred
Definition at line 92 of file XrdClXCpCtx.cc.
XRootDStatus XrdCl::XCpCtx::GetChunk | ( | XrdCl::PageInfo & | ci | ) |
Gets the next chunk from the sink, if the sink is empty blocks.
ci | : the chunk retrieved from sink (output parameter) |
Definition at line 140 of file XrdClXCpCtx.cc.
References XrdSysCondVar::Broadcast(), XrdCl::errNoMoreReplicas, XrdCl::PageInfo::GetLength(), XrdCl::stError, XrdCl::stOK, XrdCl::suContinue, XrdCl::suDone, and XrdCl::suRetry.
bool XrdCl::XCpCtx::GetNextUrl | ( | std::string & | url | ) |
Gets the next URL from the list of file replicas
url | : the output parameter |
Definition at line 57 of file XrdClXCpCtx.cc.
|
inline |
Get file size. The call blocks until the file size is being set using SetFileSize.
Definition at line 129 of file XrdClXCpCtx.hh.
References XrdSysCondVar::Wait().
XRootDStatus XrdCl::XCpCtx::Initialize | ( | ) |
Starts one thread per source, each thread tries to open a file, stat the file if necessary, and then starts reading the file, all chunks read go to the sink.
Definition at line 121 of file XrdClXCpCtx.cc.
References XrdCl::errInternal, XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::XCpSrc::Start(), XrdCl::stError, and XrdCl::UtilityMsg.
void XrdCl::XCpCtx::NotifyIdleSrc | ( | ) |
Notify idle sources, used in two case:
Definition at line 172 of file XrdClXCpCtx.cc.
References XrdSysCondVar::Broadcast().
|
inline |
Notify those who are waiting for initialization. In particular the GetSize() caller will be waiting on the result of initialization.
Definition at line 197 of file XrdClXCpCtx.hh.
References XrdSysCondVar::Broadcast().
void XrdCl::XCpCtx::PutChunk | ( | PageInfo * | chunk | ) |
|
inline |
Remove given source
src | : the source to be removed |
Definition at line 167 of file XrdClXCpCtx.hh.
Referenced by XrdCl::XCpSrc::Start().
|
inline |
void XrdCl::XCpCtx::SetFileSize | ( | int64_t | size | ) |
Set the file size (GetSize will block until SetFileSize will be called). Also calculates the block size.
size | : file size |
Definition at line 104 of file XrdClXCpCtx.cc.
References XrdSysCondVar::Broadcast().
Referenced by XCpCtx().
Get the 'weakest' sources
exclude | : the source that is excluded from the search |
Definition at line 66 of file XrdClXCpCtx.cc.
References XrdCl::XCpSrc::HasData(), and XrdCl::XCpSrc::TransferRate().