xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdFileCache::IOEntireFile Class Reference

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

#include <XrdFileCacheIOEntireFile.hh>

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

Public Member Functions

 IOEntireFile (XrdOucCacheIO2 *io, XrdOucCacheStats &stats, Cache &cache)
 Constructor. More...
 
 ~IOEntireFile ()
 Destructor. More...
 
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 XrdOucCacheIODetach ()
 
virtual bool ioActive ()
 Virtual method of XrdOucCacheIO. Called to check if destruction needs to be done in a separate task. More...
 
virtual int Fstat (struct stat &sbuff)
 
virtual long long FSize ()
 
- Public Member Functions inherited from XrdFileCache::IO
 IO (XrdOucCacheIO2 *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 (XrdOucCacheIO2 &iocp)
 
XrdSysTraceGetTrace ()
 
XrdOucCacheIO2GetInput ()
 
- Public Member Functions inherited from XrdOucCacheIO2
virtual const char * Location ()
 
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 Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 
virtual ~XrdOucCacheIO2 ()
 
- Public Member Functions inherited from XrdOucCacheIO
virtual void Preread (long long Offset, int Length, int Opts=0)
 
virtual void Preread (aprParms &Parms)
 
virtual ~XrdOucCacheIO ()
 

Private Member Functions

int initCachedStat (const char *path)
 

Private Attributes

XrdSysMutex m_mutex
 
Filem_file
 
struct statm_localStat
 

Additional Inherited Members

- Public Attributes inherited from XrdOucCacheIO
XrdOucCacheStats Statistics
 
- Static Public Attributes inherited from XrdOucCacheIO
static const int SingleUse = 0x0001
 
- Protected Member Functions inherited from XrdFileCache::IO
const char * GetPath ()
 
- Protected Attributes inherited from XrdFileCache::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

XrdFileCache::IOEntireFile::IOEntireFile ( XrdOucCacheIO2 io,
XrdOucCacheStats stats,
Cache cache 
)

Constructor.

XrdFileCache::IOEntireFile::~IOEntireFile ( )

Destructor.

Member Function Documentation

virtual XrdOucCacheIO* XrdFileCache::IOEntireFile::Detach ( )
virtual

Detach itself from Cache. Note: this will delete the object.

Returns
original source XrdPosixFile

Reimplemented from XrdOucCacheIO.

virtual long long XrdFileCache::IOEntireFile::FSize ( )
virtual

Implements XrdOucCacheIO.

virtual int XrdFileCache::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 XrdOucCacheIO2.

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

Check if File was opened successfully.

References m_file.

int XrdFileCache::IOEntireFile::initCachedStat ( const char *  path)
private
virtual bool XrdFileCache::IOEntireFile::ioActive ( )
virtual

Virtual method of XrdOucCacheIO. Called to check if destruction needs to be done in a separate task.

Reimplemented from XrdOucCacheIO.

virtual int XrdFileCache::IOEntireFile::Read ( char *  Buffer,
long long  Offset,
int  Length 
)
virtual

Implements XrdOucCacheIO.

virtual int XrdFileCache::IOEntireFile::ReadV ( const XrdOucIOVec readV,
int  n 
)
virtual

Reimplemented from XrdOucCacheIO.

Member Data Documentation

File* XrdFileCache::IOEntireFile::m_file
private

Referenced by HasFile().

struct stat* XrdFileCache::IOEntireFile::m_localStat
private
XrdSysMutex XrdFileCache::IOEntireFile::m_mutex
private

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