xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdPfc::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 <XrdPfcIOFileBlock.hh>

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

Public Member Functions

 IOFileBlock (XrdOucCacheIO *io, Cache &cache)
 
 ~IOFileBlock ()
 
bool ioActive () override
 Abstract virtual method of XrdPfc::IO Called to check if destruction needs to be done in a separate task.
 
void DetachFinalize () override
 Abstract virtual method of XrdPfc::IO Called to destruct the IO object after it is no longer used.
 
int Read (char *Buffer, long long Offset, int Length) override
 
int Fstat (struct stat &sbuff) override
 
long long FSize () override
 
void Update (XrdOucCacheIO &iocp) override
 
virtual int Read (char *buff, long long offs, int rlen)=0
 Pass Read request to the corresponding File object.
 
virtual void Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
 Pass Read request to the corresponding File object.
 
- Public Member Functions inherited from XrdPfc::IO
 IO (XrdOucCacheIO *io, Cache &cache)
 
virtual XrdOucCacheIOBase ()
 Original data source.
 
const char * Path () override
 Original data source URL.
 
int Sync () override
 
int Trunc (long long Offset) override
 
int Write (char *Buffer, long long Offset, int Length) override
 
bool Detach (XrdOucCacheIOCD &iocdP) final
 
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, int *csfix=0)
 
virtual void pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual int pgWrite (char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual void pgWrite (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual void Preread (long long offs, int rlen, int opts=0)
 
virtual void Preread (aprParms &Parms)
 
virtual int ReadV (const XrdOucIOVec *readV, int rnum)
 
virtual void ReadV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum)
 
virtual int WriteV (const XrdOucIOVec *writV, int wnum)
 
virtual void WriteV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *writV, int wnum)
 
 XrdOucCacheIO ()
 Construct and Destructor.
 

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
 
std::map< int, File * > m_blocks
 map of created blocks
 
XrdSysMutex m_mutex
 map mutex
 
struct statm_localStat
 
Info m_info
 
XrdOssDFm_info_file
 

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.
 
- Protected Member Functions inherited from XrdPfc::IO
const char * GetPath ()
 
std::string GetFilename ()
 
const char * RefreshLocation ()
 
unsigned short ObtainReadSid ()
 
- Protected Member Functions inherited from XrdOucCacheIO
virtual ~XrdOucCacheIO ()
 
- Protected Attributes inherited from XrdPfc::IO
Cachem_cache
 reference to Cache object
 
const char * m_traceID
 
RAtomic_int m_active_read_reqs
 number of active read requests
 

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()

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

◆ ~IOFileBlock()

XrdPfc::IOFileBlock::~IOFileBlock ( )

Member Function Documentation

◆ CloseInfoFile()

void XrdPfc::IOFileBlock::CloseInfoFile ( )
private

◆ DetachFinalize()

void XrdPfc::IOFileBlock::DetachFinalize ( )
overridevirtual

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

Implements XrdPfc::IO.

◆ FSize()

long long XrdPfc::IOFileBlock::FSize ( )
overridevirtual

Obtain size of the file.

Returns
Size of the file in bytes.

Implements XrdOucCacheIO.

◆ Fstat()

int XrdPfc::IOFileBlock::Fstat ( struct stat sbuff)
overridevirtual

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.

◆ GetBlockSizeFromPath()

void XrdPfc::IOFileBlock::GetBlockSizeFromPath ( )
private

◆ initLocalStat()

int XrdPfc::IOFileBlock::initLocalStat ( )
private

◆ ioActive()

bool XrdPfc::IOFileBlock::ioActive ( )
overridevirtual

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

Implements XrdPfc::IO.

◆ newBlockFile()

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

◆ Read() [1/3]

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

Pass Read request to the corresponding File object.

Implements XrdOucCacheIO.

◆ Read() [2/3]

int XrdPfc::IOFileBlock::Read ( char *  buff,
long long  offs,
int  rlen 
)
overridevirtual

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.

◆ Read() [3/3]

virtual void XrdOucCacheIO::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
)
inlinevirtual

Pass Read request to the corresponding File object.

Reimplemented from XrdOucCacheIO.

◆ Update()

void XrdPfc::IOFileBlock::Update ( XrdOucCacheIO iocp)
overridevirtual

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_blocks

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

map of created blocks

◆ m_blocksize

long long XrdPfc::IOFileBlock::m_blocksize
private

size of file-block

◆ m_info

Info XrdPfc::IOFileBlock::m_info
private

◆ m_info_file

XrdOssDF* XrdPfc::IOFileBlock::m_info_file
private

◆ m_localStat

struct stat* XrdPfc::IOFileBlock::m_localStat
private

◆ m_mutex

XrdSysMutex XrdPfc::IOFileBlock::m_mutex
private

map mutex


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