xrootd
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
XrdPfc::IO Class Referenceabstract

Base cache-io class that implements XrdOucCacheIO abstract methods. More...

#include <XrdPfcIO.hh>

Inheritance diagram for XrdPfc::IO:
Inheritance graph
[legend]
Collaboration diagram for XrdPfc::IO:
Collaboration graph
[legend]

Public Member Functions

 IO (XrdOucCacheIO *io, Cache &cache)
 
virtual XrdOucCacheIOBase ()
 Original data source. More...
 
virtual const char * Path ()
 Original data source URL. More...
 
virtual int Sync ()
 
virtual int Trunc (long long Offset)
 
virtual int Write (char *Buffer, long long Offset, int Length)
 
virtual void Update (XrdOucCacheIO &iocp)
 
bool Detach (XrdOucCacheIOCD &iocdP)
 
virtual bool ioActive ()=0
 
virtual void DetachFinalize ()=0
 
const char * GetLocation ()
 
XrdSysTraceGetTrace ()
 
XrdOucCacheIOGetInput ()
 
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 int Write (char *buff, long long offs, int wlen)=0
 
virtual void Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 
- Public Member Functions inherited from XrdOucCacheIO
virtual long long FSize ()=0
 
virtual int Fstat (struct stat &sbuff)
 
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)
 
virtual void pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, std::vector< 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 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)
 
 XrdOucCacheIO ()
 Construct and Destructor. More...
 

Protected Member Functions

const char * GetPath ()
 
std::string GetFilename ()
 
const char * RefreshLocation ()
 
- Protected Member Functions inherited from XrdOucCacheIO
virtual ~XrdOucCacheIO ()
 

Protected Attributes

Cachem_cache
 reference to Cache needed in detach More...
 
const char * m_traceID
 

Private Member Functions

void SetInput (XrdOucCacheIO *)
 

Private Attributes

XrdOucCacheIOm_io
 original data source More...
 
XrdSysMutex updMutex
 

Additional Inherited Members

- Static Public Attributes inherited from XrdOucCacheIO
static const uint64_t forceCS = 0x0000000000000001ULL
 
static const int SingleUse = 0x0001
 Mark pages for single use. More...
 

Detailed Description

Base cache-io class that implements XrdOucCacheIO abstract methods.

Constructor & Destructor Documentation

◆ IO()

XrdPfc::IO::IO ( XrdOucCacheIO io,
Cache cache 
)

Member Function Documentation

◆ Base()

virtual XrdOucCacheIO* XrdPfc::IO::Base ( )
inlinevirtual

Original data source.

References m_io.

◆ Detach()

bool XrdPfc::IO::Detach ( XrdOucCacheIOCD iocd)
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
iocdreference 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.

Implements XrdOucCacheIO.

◆ DetachFinalize()

virtual void XrdPfc::IO::DetachFinalize ( )
pure virtual

◆ GetFilename()

std::string XrdPfc::IO::GetFilename ( )
inlineprotected

References GetPath(), and XrdCl::URL::GetPath().

◆ GetInput()

XrdOucCacheIO* XrdPfc::IO::GetInput ( )

◆ GetLocation()

const char* XrdPfc::IO::GetLocation ( )
inline

References XrdOucCacheIO::Location(), and m_io.

◆ GetPath()

const char* XrdPfc::IO::GetPath ( )
inlineprotected

References m_io, and XrdOucCacheIO::Path().

Referenced by GetFilename().

◆ GetTrace()

XrdSysTrace* XrdPfc::IO::GetTrace ( )
inline

◆ ioActive()

virtual bool XrdPfc::IO::ioActive ( )
pure virtual

◆ Path()

virtual const char* XrdPfc::IO::Path ( )
inlinevirtual

Original data source URL.

Implements XrdOucCacheIO.

References m_io, and XrdOucCacheIO::Path().

◆ RefreshLocation()

const char* XrdPfc::IO::RefreshLocation ( )
inlineprotected

References XrdOucCacheIO::Location(), and m_io.

◆ SetInput()

void XrdPfc::IO::SetInput ( XrdOucCacheIO )
private

◆ Sync() [1/3]

virtual void XrdOucCacheIO::Sync
inline

Perform an asynchronous sync() 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.

◆ Sync() [2/3]

virtual int XrdOucCacheIO::Sync

Perform an synchronous sync() operation.

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

◆ Sync() [3/3]

virtual int XrdPfc::IO::Sync ( )
inlinevirtual

Perform an synchronous sync() operation.

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

Implements XrdOucCacheIO.

◆ Trunc() [1/3]

virtual void XrdOucCacheIO::Trunc
inline

Perform an asynchronous trunc() 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.
offsthe size the file is have.
Returns
<0 - Trunc failed, value is -errno. =0 - Trunc succeeded.

◆ Trunc() [2/3]

virtual int XrdOucCacheIO::Trunc

Perform an synchronous trunc() operation.

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

◆ Trunc() [3/3]

virtual int XrdPfc::IO::Trunc ( long long  offs)
inlinevirtual

Perform an synchronous trunc() operation.

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

Implements XrdOucCacheIO.

◆ Update()

virtual void XrdPfc::IO::Update ( XrdOucCacheIO iocp)
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
iocpreference to the new XrdOucCacheIO object.

Reimplemented from XrdOucCacheIO.

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

◆ Write() [1/3]

virtual void XrdOucCacheIO::Write
inline

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.
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/3]

virtual int XrdOucCacheIO::Write

Perform an synchronous write.

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

◆ Write() [3/3]

virtual int XrdPfc::IO::Write ( char *  buff,
long long  offs,
int  wlen 
)
inlinevirtual

Perform an synchronous write.

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

Implements XrdOucCacheIO.

Member Data Documentation

◆ m_cache

Cache& XrdPfc::IO::m_cache
protected

reference to Cache needed in detach

Referenced by GetTrace().

◆ m_io

XrdOucCacheIO* XrdPfc::IO::m_io
private

original data source

Referenced by Base(), GetLocation(), GetPath(), Path(), and RefreshLocation().

◆ m_traceID

const char* XrdPfc::IO::m_traceID
protected

◆ updMutex

XrdSysMutex XrdPfc::IO::updMutex
private

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