xrootd
|
#include <XrdOucCache.hh>
Classes | |
struct | aprParms |
Public Member Functions | |
virtual bool | Detach (XrdOucCacheIOCD &iocd)=0 |
virtual long long | FSize ()=0 |
virtual int | Fstat (struct stat &sbuff) |
virtual const char * | Location (bool refresh=false) |
virtual const char * | Path ()=0 |
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 (long long offs, int rlen, int opts=0) |
virtual void | Preread (aprParms &Parms) |
virtual int | Read (char *buff, long long offs, int rlen)=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 int | Sync ()=0 |
virtual void | Sync (XrdOucCacheIOCB &iocb) |
virtual int | Trunc (long long offs)=0 |
virtual void | Trunc (XrdOucCacheIOCB &iocb, long long offs) |
virtual void | Update (XrdOucCacheIO &iocp) |
virtual int | Write (char *buff, long long offs, int wlen)=0 |
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) |
XrdOucCacheIO () | |
Construct and Destructor. | |
Static Public Attributes | |
static const uint64_t | forceCS = 0x0000000000000001ULL |
static const int | SingleUse = 0x0001 |
Mark pages for single use. | |
Protected Member Functions | |
virtual | ~XrdOucCacheIO () |
The XrdOucCacheIO object is responsible for interacting with the original data source/target. It can be used with or without a front-end cache.
|
inline |
Construct and Destructor.
|
inlineprotectedvirtual |
|
pure virtual |
Detach this CacheIO object from the cache.
iocd | reference to the detach complete callback object. |
Implemented in XrdPosixPrepIO, XrdPosixFile, XrdRmcData, and XrdPfc::IO.
|
pure virtual |
Obtain size of the file.
Implemented in XrdPosixPrepIO, XrdRmcData, XrdPfc::IOFile, XrdPfc::IOFileBlock, and XrdPosixFile.
Referenced by XrdRmcData::FSize().
|
inlinevirtual |
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 in XrdPosixPrepIO, XrdPosixFile, XrdPfc::IOFile, and XrdPfc::IOFileBlock.
|
inlinevirtual |
Get the file's location (i.e. endpoint hostname and port)
refresh | - when true, recomputes the location in case it changed st the location is cached from the previous successful call. |
Reimplemented in XrdPosixFile.
|
pure virtual |
Get the path associated with this object.
Implemented in XrdPosixPrepIO, XrdRmcData, XrdPfc::IO, and XrdPosixFile.
Referenced by XrdRmcData::Path().
|
virtual |
Reimplemented in XrdPfc::IOFile, and XrdPosixFile.
Referenced by pgRead().
|
inlinevirtual |
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 in XrdPfc::IOFile, XrdPfc::IOFile, and XrdPosixFile.
References XrdOucCacheIOCB::Done(), and pgRead().
|
virtual |
Write file pages from a buffer and corresponding verified checksums.
buff | pointer to buffer holding the bytes to be written. |
offs | The offset where the write is to start. |
wrlen | The number of bytes to write. offs+wrlen (i.e. it establishes an end of file). |
csvec | A vector of that holds the corresponding verified CRC32C checksum for each page or page segment. |
opts | Processing options. |
csfix | When not nil, returns the number of corrected checksum errs. |
Reimplemented in XrdPosixFile.
Referenced by pgWrite().
|
inlinevirtual |
Write 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 holding the bytes to be written. |
offs | The offset where the write is to start. |
wrlen | The number of bytes to write. |
csvec | A vector of that holds the corresponding verified CRC32C checksum for each page or page segment. |
opts | Processing options. |
csfix | When not nil, returns the number of corrected checksum errs. |
Reimplemented in XrdPosixFile.
References XrdOucCacheIOCB::Done(), and pgWrite().
|
inlinevirtual |
Reimplemented in XrdRmcData.
|
inlinevirtual |
Reimplemented in XrdRmcData.
|
pure virtual |
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. |
Implemented in XrdPfc::IOFile, XrdPosixFile, XrdPfc::IOFileBlock, XrdPosixPrepIO, XrdRmcData, and XrdPfc::IOFileBlock.
Referenced by Read().
|
inlinevirtual |
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 in XrdPfc::IOFile, XrdPfc::IOFileBlock, XrdPosixPrepIO, and XrdPosixFile.
References XrdOucCacheIOCB::Done(), and Read().
|
virtual |
Perform an synchronous vector read.
readV | pointer to a vector of read requests. |
rnum | the number of elements in the vector. |
Reimplemented in XrdPosixPrepIO, XrdPfc::IOFile, and XrdPosixFile.
Referenced by ReadV().
|
inlinevirtual |
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 in XrdPfc::IOFile, XrdPosixFile, and XrdPosixPrepIO.
References XrdOucCacheIOCB::Done(), and ReadV().
|
pure virtual |
Perform an synchronous sync() operation.
Implemented in XrdPosixPrepIO, XrdRmcData, XrdPfc::IO, XrdPosixFile, and XrdPfc::IO.
|
inlinevirtual |
Perform an asynchronous sync() operation (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. |
Reimplemented in XrdPfc::IO, XrdPosixPrepIO, and XrdPosixFile.
References XrdOucCacheIOCB::Done(), and Sync().
Referenced by Sync().
|
pure virtual |
Perform an synchronous trunc() operation.
offs | the size the file is have. |
Implemented in XrdPfc::IO, XrdPosixPrepIO, XrdRmcData, XrdPfc::IO, and XrdPosixFile.
Referenced by Trunc().
|
inlinevirtual |
Perform an asynchronous trunc() operation (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. |
offs | the size the file is have. |
Reimplemented in XrdPfc::IO.
References XrdOucCacheIOCB::Done(), and Trunc().
|
inlinevirtual |
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 in XrdPfc::IO, XrdPfc::IOFile, and XrdPfc::IOFileBlock.
|
pure virtual |
Perform an synchronous write.
buff | pointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked. |
offs | the offset into the file. |
wlen | the number of bytes to write |
Implemented in XrdPosixFile, XrdPfc::IO, XrdPosixPrepIO, XrdRmcData, and XrdPfc::IO.
Referenced by Write().
|
inlinevirtual |
Perform an asynchronous write (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 holding the contents. The buffer must remain valid until the callback is invoked. |
offs | the offset into the file. |
wlen | the number of bytes to write |
Reimplemented in XrdPfc::IO, XrdPosixPrepIO, and XrdPosixFile.
References XrdOucCacheIOCB::Done(), and Write().
|
virtual |
Perform an synchronous vector write.
writV | pointer to a vector of write requests. |
wnum | the number of elements in the vector. |
Referenced by WriteV().
|
inlinevirtual |
Perform an asynchronous vector write (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. |
writV | pointer to a vector of read requests. |
wnum | the number of elements in the vector. |
References XrdOucCacheIOCB::Done(), and WriteV().
|
static |
Read file pages into a buffer and return corresponding checksums.
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 whose entries which will be filled with the corresponding CRC32C checksum for each page or pgae segment. If a zero length vector is returned, checksums are not present. |
opts | Processing options: forceCS - always return checksums even when not available. |
csfix | When not nil, returns the number of corrected checksum errs. |
|
static |
Mark pages for single use.
Perform an asynchronous preread (may be ignored).
offs | the offset into the file. |
rlen | the number of bytes to preread into the cache. |
opts | one or more of the options defined below. |