xrootd
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdFileCache::IOFileBlock Class Reference

Downloads original file into multiple files, chunked into blocks. Only blocks that are asked for are downloaded. Handles read requests as they come along. More...

#include <XrdFileCacheIOFileBlock.hh>

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

Public Member Functions

 IOFileBlock (XrdOucCacheIO2 *io, XrdOucCacheStats &stats, Cache &cache)
 Constructor. More...
 
 ~IOFileBlock ()
 Destructor. More...
 
virtual XrdOucCacheIODetach ()
 
virtual int Read (char *Buffer, long long Offset, int Length)
 
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 ()
 
virtual void Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
 Pass Read request to the corresponding File object. More...
 
- 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 ()
 
virtual void Sync (XrdOucCacheIOCB &iocb)
 
virtual void Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 
- 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 ()
 
virtual int Read (char *Buffer, long long Offset, int Length)=0
 
virtual int ReadV (const XrdOucIOVec *readV, int n)
 
virtual int Sync ()=0
 
virtual int Write (char *Buffer, long long Offset, int Length)=0
 
- Public Member Functions inherited from XrdOucCacheIO
virtual int ReadV (const XrdOucIOVec *readV, int n)
 
virtual void Preread (long long Offset, int Length, int Opts=0)
 
virtual void Preread (aprParms &Parms)
 
virtual ~XrdOucCacheIO ()
 

Private Member Functions

void GetBlockSizeFromPath ()
 
int initLocalStat ()
 
FilenewBlockFile (long long off, int blocksize)
 
void CloseInfoFile ()
 

Private Attributes

long long m_blocksize
 size of file-block More...
 
std::map< int, File * > m_blocks
 map of created blocks More...
 
XrdSysMutex m_mutex
 map mutex More...
 
struct statm_localStat
 
Info m_info
 
XrdOssDFm_infoFile
 

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 multiple files, chunked into blocks. Only blocks that are asked for are downloaded. Handles read requests as they come along.

Constructor & Destructor Documentation

◆ IOFileBlock()

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

Constructor.

◆ ~IOFileBlock()

XrdFileCache::IOFileBlock::~IOFileBlock ( )

Destructor.

Member Function Documentation

◆ CloseInfoFile()

void XrdFileCache::IOFileBlock::CloseInfoFile ( )
private

◆ Detach()

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

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

Returns
original source XrdPosixFile

Reimplemented from XrdOucCacheIO.

◆ FSize()

virtual long long XrdFileCache::IOFileBlock::FSize ( )
virtual

Implements XrdOucCacheIO.

◆ Fstat()

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

◆ GetBlockSizeFromPath()

void XrdFileCache::IOFileBlock::GetBlockSizeFromPath ( )
private

◆ initLocalStat()

int XrdFileCache::IOFileBlock::initLocalStat ( )
private

◆ ioActive()

virtual bool XrdFileCache::IOFileBlock::ioActive ( )
virtual

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

Reimplemented from XrdOucCacheIO.

◆ newBlockFile()

File* XrdFileCache::IOFileBlock::newBlockFile ( long long  off,
int  blocksize 
)
private

◆ Read() [1/2]

virtual void XrdOucCacheIO2::Read
inline

Pass Read request to the corresponding File object.

◆ Read() [2/2]

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

Implements XrdOucCacheIO.

Member Data Documentation

◆ m_blocks

std::map<int, File*> XrdFileCache::IOFileBlock::m_blocks
private

map of created blocks

◆ m_blocksize

long long XrdFileCache::IOFileBlock::m_blocksize
private

size of file-block

◆ m_info

Info XrdFileCache::IOFileBlock::m_info
private

◆ m_infoFile

XrdOssDF* XrdFileCache::IOFileBlock::m_infoFile
private

◆ m_localStat

struct stat* XrdFileCache::IOFileBlock::m_localStat
private

◆ m_mutex

XrdSysMutex XrdFileCache::IOFileBlock::m_mutex
private

map mutex


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