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]

List of all members.

Public Member Functions

 IOEntireFile (XrdOucCacheIO *io, XrdOucCacheStats &stats, Cache &cache)
 ~IOEntireFile ()
bool HasFile () const
 Check if File was opened successfully.
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.
void DetachFinalize ()
 Abstract virtual method of XrdPfcIO Called to destruct the IO object after it is no longer used.
virtual int Fstat (struct stat &sbuff)
virtual long long FSize ()

Private Member Functions

int initCachedStat (const char *path)

Private Attributes

Filem_file
struct stat * m_localStat

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:
sbuff reference 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:
buff pointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offs the offset into the file.
rlen the 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:
readV pointer to a vector of read requests.
rnum the 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

Referenced by HasFile().

struct stat* XrdPfc::IOEntireFile::m_localStat [read, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1