xrootd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
XrdPfc::IO Class Referenceabstract

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

#include <XrdPfcIO.hh>

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

Classes

struct  ReadReqRHCond
 

Public Member Functions

 IO (XrdOucCacheIO *io, Cache &cache)
 
virtual XrdOucCacheIOBase ()
 Original data source.
 
const char * Path () override
 Original data source URL.
 
int Sync () override
 
int Trunc (long long Offset) override
 
int Write (char *Buffer, long long Offset, int Length) override
 
void Update (XrdOucCacheIO &iocp) override
 
bool Detach (XrdOucCacheIOCD &iocdP) final
 
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, 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 WriteV (const XrdOucIOVec *writV, int wnum)
 
virtual void WriteV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *writV, int wnum)
 
 XrdOucCacheIO ()
 Construct and Destructor.
 

Protected Member Functions

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

Protected Attributes

Cachem_cache
 reference to Cache object
 
const char * m_traceID
 
RAtomic_int m_active_read_reqs
 number of active read requests
 

Private Member Functions

void SetInput (XrdOucCacheIO *)
 

Private Attributes

XrdSys::RAtomic< XrdOucCacheIO * > m_io
 original data source
 
RAtomic_ushort m_read_seqid
 sequential read id (for logging)
 
time_t m_attach_time {0}
 
int m_active_prefetches {0}
 
bool m_allow_prefetching {true}
 
bool m_in_detach {false}
 

Friends

class File
 

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.
 

Detailed Description

Base cache-io class that implements some 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)
finalvirtual

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 deferred.
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

Implemented in XrdPfc::IOFile, and XrdPfc::IOFileBlock.

◆ 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 m_io.

◆ GetPath()

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

References m_io.

Referenced by GetFilename().

◆ GetTrace()

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

◆ ioActive()

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

Implemented in XrdPfc::IOFile, and XrdPfc::IOFileBlock.

◆ ObtainReadSid()

unsigned short XrdPfc::IO::ObtainReadSid ( )
inlineprotected

References m_read_seqid.

◆ Path()

const char * XrdPfc::IO::Path ( )
inlineoverridevirtual

Original data source URL.

Implements XrdOucCacheIO.

References m_io.

◆ RefreshLocation()

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

References m_io.

◆ SetInput()

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

◆ Sync() [1/3]

int XrdPfc::IO::Sync ( )
inlineoverridevirtual

Perform an synchronous sync() operation.

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

Implements XrdOucCacheIO.

◆ Sync() [2/3]

virtual int XrdOucCacheIO::Sync ( )
virtual

Perform an synchronous sync() operation.

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

Implements XrdOucCacheIO.

◆ Sync() [3/3]

virtual void XrdOucCacheIO::Sync ( XrdOucCacheIOCB iocb)
inlinevirtual

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.

Reimplemented from XrdOucCacheIO.

◆ Trunc() [1/3]

virtual int XrdOucCacheIO::Trunc ( long long  offs)
virtual

Perform an synchronous trunc() operation.

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

Implements XrdOucCacheIO.

◆ Trunc() [2/3]

int XrdPfc::IO::Trunc ( long long  offs)
inlineoverridevirtual

Perform an synchronous trunc() operation.

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

Implements XrdOucCacheIO.

◆ Trunc() [3/3]

virtual void XrdOucCacheIO::Trunc ( XrdOucCacheIOCB iocb,
long long  offs 
)
inlinevirtual

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.

Reimplemented from XrdOucCacheIO.

◆ Update()

void XrdPfc::IO::Update ( XrdOucCacheIO iocp)
overridevirtual

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::IOFile, and XrdPfc::IOFileBlock.

◆ Write() [1/3]

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

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.

◆ Write() [2/3]

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

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.

◆ Write() [3/3]

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

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

Reimplemented from XrdOucCacheIO.

Friends And Related Symbol Documentation

◆ File

friend class File
friend

Member Data Documentation

◆ m_active_prefetches

int XrdPfc::IO::m_active_prefetches {0}
private

◆ m_active_read_reqs

RAtomic_int XrdPfc::IO::m_active_read_reqs
protected

number of active read requests

◆ m_allow_prefetching

bool XrdPfc::IO::m_allow_prefetching {true}
private

◆ m_attach_time

time_t XrdPfc::IO::m_attach_time {0}
private

◆ m_cache

Cache& XrdPfc::IO::m_cache
protected

reference to Cache object

Referenced by GetTrace().

◆ m_in_detach

bool XrdPfc::IO::m_in_detach {false}
private

◆ m_io

XrdSys::RAtomic<XrdOucCacheIO*> XrdPfc::IO::m_io
private

original data source

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

◆ m_read_seqid

RAtomic_ushort XrdPfc::IO::m_read_seqid
private

sequential read id (for logging)

Referenced by ObtainReadSid().

◆ m_traceID

const char* XrdPfc::IO::m_traceID
protected

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