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 () |
virtual const char * | Path ()=0 |
virtual int | pgRead (char *buff, long long offs, int rdlen, uint32_t *csvec, uint64_t opts=0) |
virtual void | pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, uint32_t *csvec, uint64_t opts=0) |
virtual int | pgWrite (char *buff, long long offs, int rdlen, uint32_t *csvec, uint64_t opts=0) |
virtual void | pgWrite (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wrlen, uint32_t *csvec, uint64_t opts=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. More... | |
Static Public Attributes | |
static const int | SingleUse = 0x0001 |
Mark pages for single use. More... | |
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 XrdPfc::IO, XrdRmcData, XrdPosixPrepIO, and XrdPosixFile.
|
pure virtual |
Obtain size of the file.
Implemented in XrdRmcData, XrdPosixPrepIO, XrdPosixFile, XrdPfc::IOFileBlock, XrdPfc::IOEntireFile, and XrdOucCacheData.
Referenced by XrdOucCacheData::FSize(), and 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 XrdPfc::IOFileBlock, XrdPfc::IOEntireFile, XrdPosixPrepIO, and XrdPosixFile.
|
inlinevirtual |
Get the file's location (i.e. endpoint hostname and port)
Reimplemented in XrdPosixFile.
|
pure virtual |
Get the path associated with this object.
Implemented in XrdRmcData, XrdPosixPrepIO, XrdPosixFile, XrdPfc::IO, and XrdOucCacheData.
Referenced by XrdOucCacheData::Path(), XrdPfc::IO::Path(), and XrdRmcData::Path().
|
virtual |
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. It must be page aligned. |
rdlen | The number of bytes to read. The amount must be an integral number of XrdSys::PageSize bytes. |
csvec | A vector whose entries which will be filled with the corresponding CRC32C checksum for each page; sized to: (rdlen/XrdSys::PageSize + (rdlenXrdSys::PageSize != 0). |
opts | Processing options. |
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. It must be page aligned. |
rdlen | The number of bytes to read. The amount must be an integral number of XrdSys::PageSize bytes. |
csvec | A vector of which will be filled with the corresponding CRC32C checksum for each page; sized to: (rdlen/XrdSys::PageSize + (rdlenXrdSys::PageSize != 0). |
opts | Processing options. |
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. It must be page aligned. |
wrlen | The number of bytes to write. The amount must be an integral number of XrdSys::PageSize bytes except for the last page of the file. A short write prohibits writing past offs+wrlen (i.e. it establishes an end of file). |
csvec | A vector of that holds the corresponding verified CRC32C checksum for each page; sized to: (wrlen/XrdSys::PageSize + (wrlenXrdSys::PageSize != 0). |
opts | Processing options. |
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. It must be page aligned. |
wrlen | The number of bytes to write. The amount must be an integral number of XrdSys::PageSize bytes except for the last page of the file. A short write prohibits writing past offs+wrlen (i.e. it establishes an end of file). |
csvec | A vector of that holds the corresponding verified CRC32C checksum for each page; sized to: (wrlen/XrdSys::PageSize + (wrlenXrdSys::PageSize != 0). |
opts | Processing options. |
References XrdOucCacheIOCB::Done(), and pgWrite().
|
inlinevirtual |
Reimplemented in XrdRmcData, and XrdOucCacheData.
|
inlinevirtual |
Reimplemented in XrdRmcData, and XrdOucCacheData.
|
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 XrdRmcData, XrdPosixPrepIO, XrdPfc::IOFileBlock, XrdPfc::IOEntireFile, XrdOucCacheData, and XrdPosixFile.
Referenced by XrdPfc::IOFileBlock::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 XrdPosixPrepIO, and XrdPosixFile.
|
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, XrdPosixFile, and XrdPfc::IOEntireFile.
Referenced by XrdPfc::IOEntireFile::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 XrdPosixPrepIO, and XrdPosixFile.
|
pure virtual |
Perform an synchronous sync() operation.
Implemented in XrdPfc::IO, XrdPfc::IO, XrdRmcData, XrdPosixPrepIO, XrdPosixFile, XrdPfc::IO, and XrdOucCacheData.
Referenced by XrdPfc::IO::Sync().
|
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 XrdPosixPrepIO, and XrdPosixFile.
|
pure virtual |
Perform an synchronous trunc() operation.
offs | the size the file is have. |
Implemented in XrdRmcData, XrdPosixPrepIO, XrdPosixFile, XrdPfc::IO, and XrdOucCacheData.
Referenced by XrdPfc::IO::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. |
|
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.
|
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 XrdRmcData, XrdPosixPrepIO, XrdPfc::IO, XrdOucCacheData, and XrdPosixFile.
Referenced by XrdPfc::IO::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 XrdPosixPrepIO, and XrdPosixFile.
|
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 |
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. |