![]() |
XRootD
|
Downloads original file into multiple files, chunked into blocks. Only blocks that are asked for are downloaded. Handles read requests as they come along. More...
#include <XrdPfcIOFileBlock.hh>
Public Member Functions | |
IOFileBlock (XrdOucCacheIO *io, Cache &cache) | |
~IOFileBlock () | |
void | DetachFinalize () override |
Abstract virtual method of XrdPfc::IO Called to destruct the IO object after it is no longer used. More... | |
long long | FSize () override |
int | Fstat (struct stat &sbuff) override |
bool | ioActive () override |
Abstract virtual method of XrdPfc::IO Called to check if destruction needs to be done in a separate task. More... | |
virtual int | Read (char *buff, long long offs, int rlen)=0 |
Pass Read request to the corresponding File object. More... | |
int | Read (char *Buffer, long long Offset, int Length) override |
virtual void | Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen) |
Pass Read request to the corresponding File object. More... | |
void | Update (XrdOucCacheIO &iocp) override |
![]() | |
IO (XrdOucCacheIO *io, Cache &cache) | |
virtual XrdOucCacheIO * | Base () |
Original data source. More... | |
bool | Detach (XrdOucCacheIOCD &iocdP) final |
XrdOucCacheIO * | GetInput () |
const char * | GetLocation () |
XrdSysTrace * | GetTrace () |
const char * | Path () override |
Original data source URL. More... | |
int | Sync () override |
virtual int | Sync ()=0 |
virtual void | Sync (XrdOucCacheIOCB &iocb) |
virtual int | Trunc (long long offs)=0 |
int | Trunc (long long Offset) override |
virtual void | Trunc (XrdOucCacheIOCB &iocb, long long offs) |
virtual int | Write (char *buff, long long offs, int wlen)=0 |
int | Write (char *Buffer, long long Offset, int Length) override |
virtual void | Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen) |
![]() | |
XrdOucCacheIO () | |
Construct and Destructor. More... | |
virtual const char * | Location (bool refresh=false) |
virtual int | pgRead (char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
virtual void | pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
virtual int | pgWrite (char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
virtual void | pgWrite (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
virtual void | Preread (aprParms &Parms) |
virtual void | Preread (long long offs, int rlen, int opts=0) |
virtual void | Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen) |
virtual int | ReadV (const XrdOucIOVec *readV, int rnum) |
virtual void | ReadV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum) |
virtual void | Sync (XrdOucCacheIOCB &iocb) |
virtual void | Trunc (XrdOucCacheIOCB &iocb, long long offs) |
virtual void | Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen) |
virtual int | WriteV (const XrdOucIOVec *writV, int wnum) |
virtual void | WriteV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *writV, int wnum) |
Additional Inherited Members | |
![]() | |
static const uint64_t | forceCS = 0x0000000000000001ULL |
static const int | SingleUse = 0x0001 |
Mark pages for single use. More... | |
![]() | |
std::string | GetFilename () |
const char * | GetPath () |
unsigned short | ObtainReadSid () |
const char * | RefreshLocation () |
bool | register_block_error (int res) |
bool | register_incomplete_read () |
![]() | |
virtual | ~XrdOucCacheIO () |
![]() | |
RAtomic_int | m_active_read_reqs |
number of active read requests More... | |
Cache & | m_cache |
reference to Cache object More... | |
std::map< int, int > | m_error_counts |
int | m_incomplete_count {0} |
const char * | m_traceID |
Downloads original file into multiple files, chunked into blocks. Only blocks that are asked for are downloaded. Handles read requests as they come along.
Definition at line 37 of file XrdPfcIOFileBlock.hh.
IOFileBlock::IOFileBlock | ( | XrdOucCacheIO * | io, |
Cache & | cache | ||
) |
Definition at line 40 of file XrdPfcIOFileBlock.cc.
References XrdPfc::Cache::GetInstance(), XrdPfc::Configuration::m_hdfsbsize, and XrdPfc::Cache::RefConfiguration().
IOFileBlock::~IOFileBlock | ( | ) |
|
overridevirtual |
Abstract virtual method of XrdPfc::IO Called to destruct the IO object after it is no longer used.
Implements XrdPfc::IO.
Definition at line 102 of file XrdPfcIOFileBlock.cc.
References XrdPfc::IO::m_cache, XrdPfc::Cache::ReleaseFile(), and TRACEIO.
|
overridevirtual |
Obtain size of the file.
Implements XrdOucCacheIO.
Definition at line 207 of file XrdPfcIOFileBlock.cc.
Referenced by Read().
|
overridevirtual |
Perform an fstat() operation (defaults to passthrough).
sbuff | reference to the stat buffer to be filled in. Only fields st_size, st_blocks, st_mtime (st_atime and st_ctime may be set to st_mtime), st_ino, and st_mode need to be set. All other fields are preset and should not be changed. |
Reimplemented from XrdOucCacheIO.
Definition at line 195 of file XrdPfcIOFileBlock.cc.
References stat().
|
overridevirtual |
Abstract virtual method of XrdPfc::IO Called to check if destruction needs to be done in a separate task.
Implements XrdPfc::IO.
Definition at line 78 of file XrdPfcIOFileBlock.cc.
References XrdPfc::IO::RefreshLocation().
virtual int XrdOucCacheIO::Read |
Pass Read request to the corresponding File object.
|
overridevirtual |
Perform an synchronous read.
buff | pointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked. |
offs | the offset into the file. |
rlen | the number of bytes to read. |
Implements XrdOucCacheIO.
Definition at line 287 of file XrdPfcIOFileBlock.cc.
References XrdPfc::ReadReqRH::ReadReqRH(), Macaroons::Error, FSize(), XrdPfc::IO::GetInput(), XrdSysCondVar::Lock(), XrdSysMutex::Lock(), XrdPfc::IO::ReadReqRHCond::m_cond, XrdPfc::IO::ReadReqRHCond::m_retval, XrdPfc::IO::ObtainReadSid(), XrdOucCacheIO::Read(), XrdPfc::File::Read(), TRACEIO, XrdSysCondVar::UnLock(), XrdSysMutex::UnLock(), XrdSysCondVar::Wait(), and Warning.
|
inline |
Pass Read request to the corresponding File object.
Definition at line 333 of file XrdOucCache.hh.
|
overridevirtual |
Update the originally passed XrdOucCacheIO object with the object passed. All future uses underlying XrdOucCacheIO object must now use this object. Update() is called when Prepare() indicated that the file should not be physically opened and a file method was invoked in the XrdOucCacheIO passed to Attach(). When this occurs, the file is actually opened and Update() called to replace the original XrdOucCacheIO object with one that uses the newly opened file.
iocp | reference to the new XrdOucCacheIO object. |
Reimplemented from XrdPfc::IO.
Definition at line 63 of file XrdPfcIOFileBlock.cc.
References XrdPfc::IO::Update().