xrootd
Public Member Functions | List of all members
XrdOucCacheIO2 Class Reference

#include <XrdOucCache2.hh>

Inheritance diagram for XrdOucCacheIO2:
Inheritance graph
[legend]
Collaboration diagram for XrdOucCacheIO2:
Collaboration graph
[legend]

Public Member Functions

virtual int Fstat (struct stat &sbuff)
 
virtual const char * Location ()
 
virtual void Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
 
virtual void ReadV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum)
 
virtual void Sync (XrdOucCacheIOCB &iocb)
 
virtual void Update (XrdOucCacheIO2 &iocp)
 
virtual void Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 
virtual ~XrdOucCacheIO2 ()
 
virtual int Read (char *Buffer, long long Offset, int Length)=0
 
virtual int ReadV (const XrdOucIOVec *readV, int n)
 
virtual int Sync ()=0
 
virtual int Write (char *Buffer, long long Offset, int Length)=0
 
- Public Member Functions inherited from XrdOucCacheIO
virtual long long FSize ()=0
 
virtual const char * Path ()=0
 
virtual int Read (char *Buffer, long long Offset, int Length)=0
 
virtual int ReadV (const XrdOucIOVec *readV, int n)
 
virtual int Sync ()=0
 
virtual int Trunc (long long Offset)=0
 
virtual int Write (char *Buffer, long long Offset, int Length)=0
 
virtual XrdOucCacheIOBase ()
 
virtual XrdOucCacheIODetach ()
 
virtual bool ioActive ()
 
virtual void Preread (long long Offset, int Length, int Opts=0)
 
virtual void Preread (aprParms &Parms)
 
virtual ~XrdOucCacheIO ()
 

Additional Inherited Members

- Public Attributes inherited from XrdOucCacheIO
XrdOucCacheStats Statistics
 
- Static Public Attributes inherited from XrdOucCacheIO
static const int SingleUse = 0x0001
 

Detailed Description

XrdOucCache2

This class is an extension of the original XrdOucCache class and provides async I/O support, defered open and I/O decoupling. It is loaded as a cache plugin by the POSIX package via the proxy directive

pss.cache -2 <path>

Without the "-2" the original version is loaded. Implementation of a cache is similar between versions (see XrdOucCache.hh for details). The only difference is this version requires additional methods to be implemented and uses an asynchrnous callback mechanism to return the results. The XrdOucCacheIO2 object is responsible for interacting with the original data source/target. It can be used with or without a front-end cache. It an extension of the XrdOucCacheIO class which defines base methods.

Constructor & Destructor Documentation

◆ ~XrdOucCacheIO2()

virtual XrdOucCacheIO2::~XrdOucCacheIO2 ( )
inlinevirtual

Member Function Documentation

◆ Fstat()

virtual int XrdOucCacheIO2::Fstat ( struct stat sbuff)
inlinevirtual

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

Parameters
sbuffreference 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 XrdFileCache::IOEntireFile, XrdPosixFile, XrdFileCache::IOFileBlock, XrdPosixCacheBCIO, and XrdPosixPrepIO.

Referenced by XrdPosixCacheBCIO::Fstat().

◆ Location()

virtual const char* XrdOucCacheIO2::Location ( )
inlinevirtual

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, and XrdPosixCacheBCIO.

Referenced by XrdPosixCacheBCIO::Location().

◆ Read() [1/2]

virtual int XrdOucCacheIO::Read

Perform an asynchronous read (defaults to synchrnous).

Parameters
iocbreference 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. Done() is passed < 0 - Read failed, value is -errno. >=0 - Read succeeded, value is number of bytes read.
buffpointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
rlenthe number of bytes to read.

◆ Read() [2/2]

virtual void XrdOucCacheIO2::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
)
inlinevirtual

Reimplemented in XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done().

◆ ReadV() [1/2]

virtual int XrdOucCacheIO::ReadV
inline

Perform an asynchronous vector read (defaults to synchrnous).

Parameters
iocbreference 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. Done() is passed < 0 - ReadV failed, value is -errno. >=0 - ReadV succeeded, value is number of bytes read.
readVpointer to a vector of read requests.
rnumthe number of elements in the vector.

◆ ReadV() [2/2]

virtual void XrdOucCacheIO2::ReadV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec readV,
int  rnum 
)
inlinevirtual

Reimplemented in XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done().

◆ Sync() [1/2]

virtual int XrdOucCacheIO::Sync

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

Parameters
iocbreference 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. Done() is passed <0 - Sync failed, value is -errno. =0 - Sync succeeded.

◆ Sync() [2/2]

virtual void XrdOucCacheIO2::Sync ( XrdOucCacheIOCB iocb)
inlinevirtual

Reimplemented in XrdPosixFile, and XrdPosixPrepIO.

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

Referenced by Sync().

◆ Update()

virtual void XrdOucCacheIO2::Update ( XrdOucCacheIO2 iocp)
inlinevirtual

Update the originally passed XrdOucCacheIO2 object with the object passed. All future uses underlying XrdOucCacheIO2 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 XrdOucCacheIO2 passed to Attach(). When this occurs, the file is actually opened and Update() called to replace the original XrdOucCacheIO2 object with one that uses the newly opened file.

Parameters
iocpreference to the new XrdOucCacheIO2 object.

Reimplemented in XrdFileCache::IO.

◆ Write() [1/2]

virtual int XrdOucCacheIO::Write

Perform an asynchronous write (defaults to synchronous).

Parameters
iocbreference 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. < 0 - Write failed, value is -errno. >=0 - Write succeeded, value is number of bytes written.
buffpointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
wlenthe number of bytes to write

◆ Write() [2/2]

virtual void XrdOucCacheIO2::Write ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wlen 
)
inlinevirtual

Reimplemented in XrdPosixFile, and XrdPosixPrepIO.

References XrdOucCacheIOCB::Done().


The documentation for this class was generated from the following file: