#include <XrdClXCpCtx.hh>
◆ XCpCtx()
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
- Parameters
-
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) |
◆ ~XCpCtx()
virtual XrdCl::XCpCtx::~XCpCtx |
( |
| ) |
|
|
privatevirtual |
Destructor (private).
Use Delelte to destroy the object.
◆ AllDone()
bool XrdCl::XCpCtx::AllDone |
( |
| ) |
|
Returns true if all chunks have been transferred, otherwise blocks until NotifyIdleSrc is called, or a 1 minute timeout occurs.
- Returns
- : true is all chunks have been transferred, false otherwise.
◆ Delete()
void XrdCl::XCpCtx::Delete |
( |
| ) |
|
|
inline |
◆ GetBlock()
std::pair< uint64_t, uint64_t > XrdCl::XCpCtx::GetBlock |
( |
| ) |
|
Get next block that has to be transferred
- Returns
- : pair of offset and block size
◆ GetChunk()
Gets the next chunk from the sink, if the sink is empty blocks.
- Parameters
-
ci | : the chunk retrieved from sink (output parameter) |
- Returns
- : stError if we failed to transfer the file, stOK otherwise, with one of the following codes:
- suDone : the whole file has been transferred, we are done
- suContinue : a chunk has been written into ci, continue calling GetChunk in order to retrieve remaining chunks
- suRetry : a chunk has not been written into ci, try again.
◆ GetNextUrl()
bool XrdCl::XCpCtx::GetNextUrl |
( |
std::string & |
url | ) |
|
Gets the next URL from the list of file replicas
- Parameters
-
url | : the output parameter |
- Returns
- : true if a url has been written to the url parameter, false otherwise
◆ GetRunning()
size_t XrdCl::XCpCtx::GetRunning |
( |
| ) |
|
|
private |
Returns the number of active sources
- Returns
- : number of active sources
Referenced by GetSize().
◆ GetSize()
int64_t XrdCl::XCpCtx::GetSize |
( |
| ) |
|
|
inline |
◆ 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.
- Returns
- Error if we were not able to create any threads
◆ NotifyIdleSrc()
void XrdCl::XCpCtx::NotifyIdleSrc |
( |
| ) |
|
Notify idle sources, used in two case:
- if one of the sources failed and an idle source needs to take over
- or if we are done and all idle source should be stopped
◆ NotifyInitExpectant()
void XrdCl::XCpCtx::NotifyInitExpectant |
( |
| ) |
|
|
inline |
◆ PutChunk()
void XrdCl::XCpCtx::PutChunk |
( |
PageInfo * |
chunk | ) |
|
Put a chunk into the sink
- Parameters
-
◆ RemoveSrc()
void XrdCl::XCpCtx::RemoveSrc |
( |
XCpSrc * |
src | ) |
|
|
inline |
Remove given source
- Parameters
-
src | : the source to be removed |
References pMtx, and pSources.
◆ Self()
XCpCtx * XrdCl::XCpCtx::Self |
( |
| ) |
|
|
inline |
Increments the reference counter.
- Returns
- : myself.
References pMtx, and pRefCount.
◆ SetFileSize()
void XrdCl::XCpCtx::SetFileSize |
( |
int64_t |
size | ) |
|
Set the file size (GetSize will block until SetFileSize will be called). Also calculates the block size.
- Parameters
-
◆ WeakestLink()
Get the 'weakest' sources
- Parameters
-
exclude | : the source that is excluded from the search |
- Returns
- : the weakest source
◆ pBlockSize
uint64_t XrdCl::XCpCtx::pBlockSize |
|
private |
The size of the block allocated to a single source.
◆ pChunkSize
uint32_t XrdCl::XCpCtx::pChunkSize |
|
private |
◆ pDataReceived
uint64_t XrdCl::XCpCtx::pDataReceived |
|
private |
Total amount of data received
◆ pDone
bool XrdCl::XCpCtx::pDone |
|
private |
A flag, true if all chunks have been received and we are done, false otherwise
◆ pDoneCV
A condition variable, idle sources wait on this cond var until we are done, or until one of the active sources fails.
◆ pFileSize
int64_t XrdCl::XCpCtx::pFileSize |
|
private |
◆ pFileSizeCV
◆ pMtx
◆ pOffset
uint64_t XrdCl::XCpCtx::pOffset |
|
private |
Offset in the file (everything before the offset has been allocated, everything after the offset needs to be allocated)
◆ pParallelChunks
uint8_t XrdCl::XCpCtx::pParallelChunks |
|
private |
Number of parallel chunks per source.
◆ pParallelSrc
uint8_t XrdCl::XCpCtx::pParallelSrc |
|
private |
Number of parallel sources.
◆ pRefCount
size_t XrdCl::XCpCtx::pRefCount |
|
private |
◆ pSink
A queue shared between all the sources (producers), and the extreme copy context (consumer).
◆ pSources
std::list<XCpSrc*> XrdCl::XCpCtx::pSources |
|
private |
List of sources. Those pointers are not owned by this object.
Referenced by RemoveSrc().
◆ pUrls
std::queue<std::string> XrdCl::XCpCtx::pUrls |
|
private |
The URLs of all the replicas that were provided to us.
The documentation for this class was generated from the following file: