xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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, XrdOucCacheStats &stats, 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)
 
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 ()
 
- Public Member Functions inherited from XrdPfc::IO
 IO (XrdOucCacheIO *io, XrdOucCacheStats &stats, 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)
 
XrdSysTraceGetTrace ()
 
XrdOucCacheIOGetInput ()
 
- Public Member Functions inherited from XrdOucCacheIO
virtual const char * Location ()
 
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 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 int SingleUse = 0x0001
 Mark pages for single use. More...
 
- Protected Member Functions inherited from XrdPfc::IO
const char * GetPath ()
 
- Protected Member Functions inherited from XrdOucCacheIO
virtual ~XrdOucCacheIO ()
 
- Protected Attributes inherited from XrdPfc::IO
XrdOucCacheStatsm_statsGlobal
 reference to Cache statistics More...
 
Cachem_cache
 reference to Cache needed in detach More...
 
const char * m_traceID
 
std::string m_path
 

Detailed Description

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

Constructor & Destructor Documentation

XrdPfc::IOEntireFile::IOEntireFile ( XrdOucCacheIO io,
XrdOucCacheStats stats,
Cache cache 
)
XrdPfc::IOEntireFile::~IOEntireFile ( )

Member Function Documentation

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.

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

Obtain size of the file.

Returns
Size of the file in bytes.

Implements XrdOucCacheIO.

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.

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

Check if File was opened successfully.

References m_file.

int XrdPfc::IOEntireFile::initCachedStat ( const char *  path)
private
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.

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.

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.

Member Data Documentation

File* XrdPfc::IOEntireFile::m_file
private

Referenced by HasFile().

struct stat* XrdPfc::IOEntireFile::m_localStat
private

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