XrdCl::XCpCtx Class Reference
#include <XrdClXCpCtx.hh>
List of all members.
Constructor & Destructor Documentation
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) |
virtual XrdCl::XCpCtx::~XCpCtx |
( |
|
) |
[private, virtual] |
Destructor (private).
Use Delelte to destroy the object.
Member Function Documentation
bool XrdCl::XCpCtx::AllDone |
( |
|
) |
|
Returns true if all chunks have been transfered, otherwise blocks until NotifyIdleSrc is called, or a 1 minute timeout occurs.
- Returns:
- : true is all chunks have been transfered, false otherwise.
void XrdCl::XCpCtx::Delete |
( |
|
) |
[inline] |
std::pair<uint64_t, uint64_t> XrdCl::XCpCtx::GetBlock |
( |
|
) |
|
Get next block that has to be transfered
- Returns:
- : pair of offset and block size
Gets the next chunk from the sink, if the sink is empty blocks.
- Parameters:
-
| ci | : the chunk retrieved from sink (output parameter) : stError if we failed to transfer the file, stOK otherwise, with one of the following codes:
- suDone : the whole file has been transfered, 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.
|
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
size_t XrdCl::XCpCtx::GetRunning |
( |
|
) |
[private] |
Returns the number of active sources
- Returns:
- : number of active sources
Referenced by GetSize().
int64_t XrdCl::XCpCtx::GetSize |
( |
|
) |
[inline] |
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
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
void XrdCl::XCpCtx::NotifyInitExpectant |
( |
|
) |
[inline] |
void XrdCl::XCpCtx::PutChunk |
( |
ChunkInfo * |
chunk |
) |
|
Put a chunk into the sink
- Parameters:
-
void XrdCl::XCpCtx::RemoveSrc |
( |
XCpSrc * |
src |
) |
[inline] |
Remove given source
- Parameters:
-
| src | : the source to be removed |
References pMtx, and pSources.
XCpCtx* XrdCl::XCpCtx::Self |
( |
|
) |
[inline] |
Increments the reference counter.
- Returns:
- : myself.
References pMtx, and pRefCount.
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:
-
Get the 'weakest' sources
- Parameters:
-
| exclude | : the source that is excluded from the search |
- Returns:
- : the weakest source
Member Data Documentation
The size of the block allocated to a single source.
Total amount of data received
A flag, true if all chunks have been received and we are done, false otherwise
A condition variable, idle sources wait on this cond var until we are done, or until one of the active sources fails.
Offset in the file (everything before the offset has been allocated, everything after the offset needs to be allocated)
Number of parallel chunks per source.
Number of parallel sources.
A queue shared between all the sources (producers), and the extreme copy context (consumer).
List of sources. Those pointers are not owned by this object.
Referenced by RemoveSrc().
The URLs of all the replicas that were provided to us.
The documentation for this class was generated from the following file: