![]() |
XRootD
|
Downloads original file into a single file on local disk. Handles read requests as they come along. More...
#include <XrdPfcIOFile.hh>
Public Member Functions | |
IOFile (XrdOucCacheIO *io, Cache &cache) | |
~IOFile () | |
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 | HasFile () const |
Check if File was opened successfully. More... | |
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 | pgRead (char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
void | pgRead (XrdOucCacheIOCB &iocb, char *buff, long long off, int size, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) override |
virtual void | pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) |
int | Read (char *buff, long long off, int size) override |
Pass Read request to the corresponding File object. More... | |
void | Read (XrdOucCacheIOCB &iocb, char *buff, long long off, int size) override |
int | ReadV (const XrdOucIOVec *readV, int n) override |
Pass ReadV request to the corresponding File object. More... | |
void | ReadV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int n) override |
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 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 | 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 a single file on local disk. Handles read requests as they come along.
Definition at line 38 of file XrdPfcIOFile.hh.
IOFile::IOFile | ( | XrdOucCacheIO * | io, |
Cache & | cache | ||
) |
Definition at line 36 of file XrdPfcIOFile.cc.
References XrdPfc::Cache::GetFile(), XrdPfc::IO::GetFilename(), and XrdPfc::Cache::GetInstance().
IOFile::~IOFile | ( | ) |
|
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 114 of file XrdPfcIOFile.cc.
References Macaroons::Debug, Macaroons::Error, XrdPfc::Cache::GetInstance(), XrdPfc::IO::m_error_counts, XrdPfc::IO::m_incomplete_count, XrdPfc::Cache::ReleaseFile(), XrdPfc::File::RequestSyncOfDetachStats(), TRACE, TRACE_Error, and XRD_TRACE.
|
overridevirtual |
Obtain size of the file.
Implements XrdOucCacheIO.
Definition at line 66 of file XrdPfcIOFile.cc.
References XrdPfc::File::GetFileSize().
|
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 52 of file XrdPfcIOFile.cc.
References XrdPfc::File::Fstat().
|
inline |
Check if File was opened successfully.
Definition at line 48 of file XrdPfcIOFile.hh.
Referenced by XrdPfc::Cache::Attach().
|
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 107 of file XrdPfcIOFile.cc.
References XrdPfc::File::ioActive(), and XrdPfc::IO::RefreshLocation().
int XrdOucCacheIO::pgRead |
Definition at line 190 of file XrdOucCache.cc.
|
overridevirtual |
Read file pages and checksums using asynchronous I/O (default sync).
iocb | reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread. |
buff | pointer to buffer where the bytes are to be placed. |
offs | The offset where the read is to start. |
rdlen | The number of bytes to read. |
csvec | A vector which will be filled with the corresponding CRC32C checksum for each page or page segment. |
opts | Processing options: forceCS - always return checksums even when not available. |
csfix | When not nil, returns the number of corrected checksum errs. |
Reimplemented from XrdOucCacheIO.
Definition at line 196 of file XrdPfcIOFile.cc.
References XrdPfc::ReadReqRH::ReadReqRH(), XrdOucPgrwUtils::csCalc(), XrdOucCacheIO::forceCS, Xrd::hex1, XrdPfc::IO::m_active_read_reqs, XrdPfc::IO::ObtainReadSid(), opts, and TRACEIO.
|
inline |
Read file pages and checksums using asynchronous I/O (default sync).
iocb | reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread. |
buff | pointer to buffer where the bytes are to be placed. |
offs | The offset where the read is to start. |
rdlen | The number of bytes to read. |
csvec | A vector which will be filled with the corresponding CRC32C checksum for each page or page segment. |
opts | Processing options: forceCS - always return checksums even when not available. |
csfix | When not nil, returns the number of corrected checksum errs. |
Definition at line 214 of file XrdOucCache.hh.
|
overridevirtual |
Pass Read request to the corresponding File object.
Implements XrdOucCacheIO.
Definition at line 149 of file XrdPfcIOFile.cc.
References Xrd::hex1, XrdPfc::IO::m_active_read_reqs, XrdPfc::IO::ObtainReadSid(), and TRACEIO.
|
overridevirtual |
Perform an asynchronous read (defaults to synchronous).
iocb | reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread. |
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. |
Reimplemented from XrdOucCacheIO.
Definition at line 170 of file XrdPfcIOFile.cc.
References XrdPfc::ReadReqRH::ReadReqRH(), Xrd::hex1, XrdPfc::IO::m_active_read_reqs, XrdPfc::IO::ObtainReadSid(), and TRACEIO.
|
overridevirtual |
Pass ReadV request to the corresponding File object.
Reimplemented from XrdOucCacheIO.
Definition at line 275 of file XrdPfcIOFile.cc.
References Xrd::hex1, XrdPfc::IO::m_active_read_reqs, XrdPfc::ReadReqRH::m_seq_id, XrdPfc::IO::ObtainReadSid(), and TRACEIO.
|
overridevirtual |
Perform an asynchronous vector read (defaults to synchronous).
iocb | reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread. |
readV | pointer to a vector of read requests. |
rnum | the number of elements in the vector. |
Reimplemented from XrdOucCacheIO.
Definition at line 295 of file XrdPfcIOFile.cc.
References XrdPfc::ReadReqRH::ReadReqRH(), XrdOucCacheIOCB::Done(), Xrd::hex1, XrdPfc::IO::m_active_read_reqs, XrdPfc::ReadReqRH::m_seq_id, XrdPfc::IO::ObtainReadSid(), and TRACEIO.
|
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 100 of file XrdPfcIOFile.cc.
References XrdPfc::File::ioUpdated(), and XrdPfc::IO::Update().