xrootd
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdPfc::IOEntireFile Class Reference

Downloads original file into a single file on local disk. Handles read requests as they come along. More...

#include <XrdPfcIOEntireFile.hh>

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

Public Member Functions

 IOEntireFile (XrdOucCacheIO *io, Cache &cache)
 
 ~IOEntireFile ()
 
bool HasFile () const
 Check if File was opened successfully. More...
 
virtual int Read (char *Buffer, long long Offset, int Length)
 
virtual int ReadV (const XrdOucIOVec *readV, int n)
 
virtual void Update (XrdOucCacheIO &iocp)
 
bool ioActive ()
 Abstract virtual method of XrdPfcIO Called to check if destruction needs to be done in a separate task. More...
 
void DetachFinalize ()
 Abstract virtual method of XrdPfcIO Called to destruct the IO object after it is no longer used. More...
 
virtual int Fstat (struct stat &sbuff)
 
virtual long long FSize ()
 
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)
 
- Public Member Functions inherited from XrdPfc::IO
 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)
 
bool Detach (XrdOucCacheIOCD &iocdP)
 
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 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 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 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...
 

Private Member Functions

int initCachedStat (const char *path)
 

Private Attributes

Filem_file
 
struct statm_localStat
 

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...
 
- Protected Member Functions inherited from XrdPfc::IO
const char * GetPath ()
 
std::string GetFilename ()
 
const char * RefreshLocation ()
 
- Protected Member Functions inherited from XrdOucCacheIO
virtual ~XrdOucCacheIO ()
 
- Protected Attributes inherited from XrdPfc::IO
Cachem_cache
 reference to Cache needed in detach More...
 
const char * m_traceID
 

Detailed Description

Downloads original file into a single file on local disk. Handles read requests as they come along.

Constructor & Destructor Documentation

◆ IOEntireFile()

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

◆ ~IOEntireFile()

XrdPfc::IOEntireFile::~IOEntireFile ( )

Member Function Documentation

◆ DetachFinalize()

void XrdPfc::IOEntireFile::DetachFinalize ( )
virtual

Abstract virtual method of XrdPfcIO Called to destruct the IO object after it is no longer used.

Implements XrdPfc::IO.

◆ FSize()

virtual long long XrdPfc::IOEntireFile::FSize ( )
virtual

Obtain size of the file.

Returns
Size of the file in bytes.

Implements XrdOucCacheIO.

◆ Fstat()

virtual int XrdPfc::IOEntireFile::Fstat ( struct stat sbuff)
virtual

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 from XrdOucCacheIO.

◆ HasFile()

bool XrdPfc::IOEntireFile::HasFile ( ) const
inline

Check if File was opened successfully.

References m_file.

◆ initCachedStat()

int XrdPfc::IOEntireFile::initCachedStat ( const char *  path)
private

◆ ioActive()

bool XrdPfc::IOEntireFile::ioActive ( )
virtual

Abstract virtual method of XrdPfcIO Called to check if destruction needs to be done in a separate task.

Implements XrdPfc::IO.

◆ Read() [1/3]

virtual int XrdOucCacheIO::Read

Pass Read request to the corresponding File object.

Parameters
Buffer
Offset
Length
Returns
number of bytes read

◆ Read() [2/3]

virtual void XrdOucCacheIO::Read
inline

Pass Read request to the corresponding File object.

Parameters
Buffer
Offset
Length
Returns
number of bytes read

◆ Read() [3/3]

virtual int XrdPfc::IOEntireFile::Read ( char *  buff,
long long  offs,
int  rlen 
)
virtual

Perform an synchronous read.

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

Implements XrdOucCacheIO.

◆ ReadV() [1/3]

virtual void XrdOucCacheIO::ReadV
inline

Pass ReadV request to the corresponding File object.

Parameters
readV
nnumber of XrdOucIOVecs
Returns
total bytes read

◆ ReadV() [2/3]

virtual int XrdOucCacheIO::ReadV

Pass ReadV request to the corresponding File object.

Parameters
readV
nnumber of XrdOucIOVecs
Returns
total bytes read

◆ ReadV() [3/3]

virtual int XrdPfc::IOEntireFile::ReadV ( const XrdOucIOVec readV,
int  rnum 
)
virtual

Perform an synchronous vector read.

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

Reimplemented from XrdOucCacheIO.

◆ Update()

virtual void XrdPfc::IOEntireFile::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 XrdPfc::IO.

Member Data Documentation

◆ m_file

File* XrdPfc::IOEntireFile::m_file
private

Referenced by HasFile().

◆ m_localStat

struct stat* XrdPfc::IOEntireFile::m_localStat
private

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