XrdOucCacheIO Class Reference

#include <XrdOucCache.hh>

Inheritance diagram for XrdOucCacheIO:
Inheritance graph
[legend]

List of all members.

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.

Static Public Attributes

static const int SingleUse = 0x0001
 Mark pages for single use.

Protected Member Functions

virtual ~XrdOucCacheIO ()

Detailed Description

The XrdOucCacheIO object is responsible for interacting with the original data source/target. It can be used with or without a front-end cache.


Constructor & Destructor Documentation

XrdOucCacheIO::XrdOucCacheIO (  )  [inline]

Construct and Destructor.

virtual XrdOucCacheIO::~XrdOucCacheIO (  )  [inline, protected, virtual]

Member Function Documentation

virtual bool XrdOucCacheIO::Detach ( XrdOucCacheIOCD iocd  )  [pure virtual]

Detach this CacheIO object from the cache.

Note:
This method must be called instead of using the delete operator since CacheIO objects may have multiple outstanding references and actual deletion may need to be defered.
Parameters:
iocd reference to the detach complete callback object.
Returns:
true Deletion can occur immediately. There is no outstanding I/O.
false Deletion must be deferred until it is safe to so from the cache perspective. At which point, the cache will call the DetachDone() method in the passed callback object. No locks may be held with respect to the CacheIO object when this is done to avoid deadlocks.

Implemented in XrdPfc::IO, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

virtual long long XrdOucCacheIO::FSize (  )  [pure virtual]

Obtain size of the file.

Returns:
Size of the file in bytes.

Implemented in XrdOucCacheData, XrdPfc::IOEntireFile, XrdPfc::IOFileBlock, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

Referenced by XrdRmcData::FSize(), and XrdOucCacheData::FSize().

virtual int XrdOucCacheIO::Fstat ( struct stat &  sbuff  )  [inline, virtual]

Perform an fstat() operation (defaults to passthrough).

Parameters:
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.
Returns:
<0 - fstat failed, value is -errno. =0 - fstat succeeded, sbuff holds stat information. >0 - fstat could not be done, forward operation to next level.

Reimplemented in XrdPfc::IOEntireFile, XrdPfc::IOFileBlock, XrdPosixFile, and XrdPosixPrepIO.

virtual const char* XrdOucCacheIO::Location (  )  [inline, virtual]

Get the file's location (i.e. endpoint hostname and port)

Returns:
A pointer to the file's location. It remains valid until the file is closed. A null string means the file is not open or is unknown.

Reimplemented in XrdPosixFile.

virtual const char* XrdOucCacheIO::Path (  )  [pure virtual]

Get the path associated with this object.

Returns:
Pointer to the path.

Implemented in XrdOucCacheData, XrdPfc::IO, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

Referenced by XrdRmcData::Path(), XrdPfc::IO::Path(), and XrdOucCacheData::Path().

virtual void XrdOucCacheIO::pgRead ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rdlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [inline, virtual]

Read file pages and checksums using asynchronous I/O (default sync).

Parameters:
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/XrdSysPageSize + (rdlenXrdSysPageSize != 0).
opts Processing options.

References XrdOucCacheIOCB::Done(), and pgRead().

Referenced by pgRead().

virtual int XrdOucCacheIO::pgRead ( char *  buff,
long long  offs,
int  rdlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [virtual]

Read file pages into a buffer and return corresponding checksums.

Parameters:
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/XrdSysPageSize + (rdlenXrdSysPageSize != 0).
opts Processing options.
Returns:
>= 0 The number of bytes placed in buffer.
-errno File could not be read, return value is the reason.
virtual void XrdOucCacheIO::pgWrite ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wrlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [inline, virtual]

Write file pages and checksums using asynchronous I/O (default sync).

Parameters:
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/XrdSysPageSize + (wrlenXrdSysPageSize != 0).
opts Processing options.

References XrdOucCacheIOCB::Done(), and pgWrite().

Referenced by pgWrite().

virtual int XrdOucCacheIO::pgWrite ( char *  buff,
long long  offs,
int  rdlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [virtual]

Write file pages from a buffer and corresponding verified checksums.

Parameters:
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/XrdSysPageSize + (wrlenXrdSysPageSize != 0).
opts Processing options.
Returns:
>= 0 The number of bytes written.
-errno File could not be written, returned value is the reason.
virtual void XrdOucCacheIO::Preread ( aprParms Parms  )  [inline, virtual]

Reimplemented in XrdRmcData.

virtual void XrdOucCacheIO::Preread ( long long  offs,
int  rlen,
int  opts = 0 
) [inline, virtual]

Reimplemented in XrdOucCacheData, and XrdRmcData.

virtual void XrdOucCacheIO::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
) [inline, virtual]

Perform an asynchronous read (defaults to synchronous).

Parameters:
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 XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done(), and Read().

Referenced by Read().

virtual int XrdOucCacheIO::Read ( char *  buff,
long long  offs,
int  rlen 
) [pure virtual]

Perform an synchronous read.

Parameters:
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.
Returns:
< 0 - Read failed, value is -errno. >=0 - Read succeeded, value is number of bytes read.

Implemented in XrdOucCacheData, XrdPfc::IOEntireFile, XrdPfc::IOFileBlock, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

virtual void XrdOucCacheIO::ReadV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec readV,
int  rnum 
) [inline, virtual]

Perform an asynchronous vector read (defaults to synchronous).

Parameters:
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 XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done(), and ReadV().

Referenced by ReadV().

virtual int XrdOucCacheIO::ReadV ( const XrdOucIOVec readV,
int  rnum 
) [virtual]

Perform an synchronous vector read.

Parameters:
readV pointer to a vector of read requests.
rnum the number of elements in the vector.
Returns:
< 0 - ReadV failed, value is -errno. >=0 - ReadV succeeded, value is number of bytes read.

Reimplemented in XrdPfc::IOEntireFile, XrdPosixFile, and XrdPosixPrepIO.

virtual void XrdOucCacheIO::Sync ( XrdOucCacheIOCB iocb  )  [inline, virtual]

Perform an asynchronous sync() operation (defaults to synchronous).

Parameters:
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 XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done(), and Sync().

Referenced by Sync().

virtual int XrdOucCacheIO::Sync (  )  [pure virtual]

Perform an synchronous sync() operation.

Returns:
<0 - Sync failed, value is -errno. =0 - Sync succeeded.

Implemented in XrdOucCacheData, XrdPfc::IO, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

virtual void XrdOucCacheIO::Trunc ( XrdOucCacheIOCB iocb,
long long  offs 
) [inline, virtual]

Perform an asynchronous trunc() operation (defaults to synchronous).

Parameters:
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.
Returns:
<0 - Trunc failed, value is -errno. =0 - Trunc succeeded.

References XrdOucCacheIOCB::Done(), and Trunc().

Referenced by Trunc().

virtual int XrdOucCacheIO::Trunc ( long long  offs  )  [pure virtual]

Perform an synchronous trunc() operation.

Parameters:
offs the size the file is have.
Returns:
<0 - Trunc failed, value is -errno. =0 - Trunc succeeded.

Implemented in XrdOucCacheData, XrdPfc::IO, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

virtual void XrdOucCacheIO::Update ( XrdOucCacheIO iocp  )  [inline, virtual]

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.

Parameters:
iocp reference to the new XrdOucCacheIO object.
virtual void XrdOucCacheIO::Write ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wlen 
) [inline, virtual]

Perform an asynchronous write (defaults to synchronous).

Parameters:
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 XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done(), and Write().

Referenced by Write().

virtual int XrdOucCacheIO::Write ( char *  buff,
long long  offs,
int  wlen 
) [pure virtual]

Perform an synchronous write.

Parameters:
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
Returns:
< 0 - Write failed, value is -errno. >=0 - Write succeeded, value is number of bytes written.

Implemented in XrdOucCacheData, XrdPfc::IO, XrdPosixFile, XrdPosixPrepIO, and XrdRmcData.

virtual void XrdOucCacheIO::WriteV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec writV,
int  wnum 
) [inline, virtual]

Perform an asynchronous vector write (defaults to synchronous).

Parameters:
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().

Referenced by WriteV().

virtual int XrdOucCacheIO::WriteV ( const XrdOucIOVec writV,
int  wnum 
) [virtual]

Perform an synchronous vector write.

Parameters:
writV pointer to a vector of write requests.
wnum the number of elements in the vector.
Returns:
< 0 - WriteV failed, value is -errno. >=0 - WriteV succeeded, value is number of bytes written.

Member Data Documentation

const int XrdOucCacheIO::SingleUse = 0x0001 [static]

Mark pages for single use.

Perform an asynchronous preread (may be ignored).

Parameters:
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.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1