xrootd
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
XrdFileCache::Info Class Reference

Status of cached file. Can be read from and written into a binary file. More...

#include <XrdFileCacheInfo.hh>

Collaboration diagram for XrdFileCache::Info:
Collaboration graph
[legend]

Classes

struct  AStat
 
struct  Store
 

Public Member Functions

 Info (XrdSysTrace *trace, bool prefetchBuffer=false)
 Constructor. More...
 
 ~Info ()
 Destructor. More...
 
void SetBitWritten (int i)
 Mark block as downloaded. More...
 
void SetBitSynced (int i)
 Mark block as disk written. More...
 
void SetAllBitsSynced ()
 Mark all blocks as writte. More...
 
void SetBitPrefetch (int i)
 Mark block as written from prefetchxs. More...
 
void SetBufferSize (long long)
 
void SetFileSize (long long)
 
void ResizeBits (int n)
 Reserve buffer for fileSize/bufferSize bytes. More...
 
bool Read (XrdOssDF *fp, const std::string &fname="<unknown>")
 Rea load content from cinfo file into this object. More...
 
bool Write (XrdOssDF *fp, const std::string &fname="<unknown>")
 
void DisableDownloadStatus ()
 Disable allocating, writing, and reading of downlaod status. More...
 
void ResetAllAccessStats ()
 Reset IO Stats. More...
 
void WriteIOStatAttach ()
 Write open time in the last entry of access statistics. More...
 
void WriteIOStat (Stats &s)
 Write bytes missed, hits, and disk. More...
 
void WriteIOStatDetach (Stats &s)
 Write close time together with bytes missed, hits, and disk. More...
 
void WriteIOStatSingle (long long bytes_disk)
 Write single open/close time for given bytes read from disk. More...
 
void WriteIOStatSingle (long long bytes_disk, time_t att, time_t dtc)
 Write open/close with given time and bytes read from disk. More...
 
bool IsAnythingEmptyInRng (int firstIdx, int lastIdx) const
 Check download status in given block range. More...
 
int GetSizeInBytes () const
 Get size of download-state bit-vector in bytes. More...
 
int GetSizeInBits () const
 Get number of blocks represented in download-state bit-vector. More...
 
long long GetFileSize () const
 Get file size. More...
 
bool GetLatestDetachTime (time_t &t) const
 Get latest detach time. More...
 
long long GetBufferSize () const
 Get prefetch buffer size. More...
 
bool TestBit (int i) const
 Test if block at the given index is downlaoded. More...
 
bool TestPrefetchBit (int i) const
 Test if block at the given index is prewritten. More...
 
bool IsComplete () const
 Get complete status. More...
 
int GetNDownloadedBlocks () const
 Get number of downloaded blocks. More...
 
long long GetNDownloadedBytes () const
 Get number of downloaded bytes. More...
 
int GetLastDownloadedBlock () const
 Get number of the last downloaded block. More...
 
long long GetExpectedDataFileSize () const
 Get expected data file size. More...
 
void UpdateDownloadCompleteStatus ()
 Update complete status. More...
 
size_t GetAccessCnt ()
 Get number of accesses. More...
 
int GetVersion ()
 Get version. More...
 
const StoreRefStoredData () const
 Get stored data. More...
 
void GetCksum (unsigned char *buff, char *digest)
 Get md5 cksum. More...
 
XrdSysTraceGetTrace () const
 

Static Public Member Functions

static size_t GetMaxNumAccess ()
 

Static Public Attributes

static const char * m_infoExtension
 
static const char * m_traceID
 
static const int m_defaultVersion
 
static const size_t m_maxNumAccess
 

Protected Attributes

XrdSysTracem_trace
 
Store m_store
 
bool m_hasPrefetchBuffer
 constains current prefetch score More...
 
unsigned char * m_buff_written
 download state vector More...
 
unsigned char * m_buff_prefetch
 prefetch statistics More...
 
int m_sizeInBits
 cached More...
 
bool m_complete
 cached More...
 

Private Member Functions

unsigned char cfiBIT (int n) const
 
bool ReadV1 (XrdOssDF *fp, const std::string &fname)
 

Private Attributes

XrdCksCalcm_cksCalc
 

Detailed Description

Status of cached file. Can be read from and written into a binary file.

Constructor & Destructor Documentation

◆ Info()

XrdFileCache::Info::Info ( XrdSysTrace trace,
bool  prefetchBuffer = false 
)

Constructor.

◆ ~Info()

XrdFileCache::Info::~Info ( )

Destructor.

Member Function Documentation

◆ cfiBIT()

unsigned char XrdFileCache::Info::cfiBIT ( int  n) const
inlineprivate

◆ DisableDownloadStatus()

void XrdFileCache::Info::DisableDownloadStatus ( )

Disable allocating, writing, and reading of downlaod status.

◆ GetAccessCnt()

size_t XrdFileCache::Info::GetAccessCnt ( )
inline

Get number of accesses.

References XrdFileCache::Info::Store::m_accessCnt, and m_store.

◆ GetBufferSize()

long long XrdFileCache::Info::GetBufferSize ( ) const
inline

Get prefetch buffer size.

References XrdFileCache::Info::Store::m_bufferSize, and m_store.

◆ GetCksum()

void XrdFileCache::Info::GetCksum ( unsigned char *  buff,
char *  digest 
)

Get md5 cksum.

◆ GetExpectedDataFileSize()

long long XrdFileCache::Info::GetExpectedDataFileSize ( ) const
inline

◆ GetFileSize()

long long XrdFileCache::Info::GetFileSize ( ) const
inline

Get file size.

References XrdFileCache::Info::Store::m_fileSize, and m_store.

◆ GetLastDownloadedBlock()

int XrdFileCache::Info::GetLastDownloadedBlock ( ) const
inline

Get number of the last downloaded block.

References m_sizeInBits, and TestBit().

Referenced by GetExpectedDataFileSize().

◆ GetLatestDetachTime()

bool XrdFileCache::Info::GetLatestDetachTime ( time_t &  t) const

Get latest detach time.

◆ GetMaxNumAccess()

static size_t XrdFileCache::Info::GetMaxNumAccess ( )
inlinestatic

References m_maxNumAccess.

◆ GetNDownloadedBlocks()

int XrdFileCache::Info::GetNDownloadedBlocks ( ) const
inline

Get number of downloaded blocks.

References m_sizeInBits, and TestBit().

Referenced by GetNDownloadedBytes().

◆ GetNDownloadedBytes()

long long XrdFileCache::Info::GetNDownloadedBytes ( ) const
inline

Get number of downloaded bytes.

References GetNDownloadedBlocks(), XrdFileCache::Info::Store::m_bufferSize, and m_store.

◆ GetSizeInBits()

int XrdFileCache::Info::GetSizeInBits ( ) const
inline

Get number of blocks represented in download-state bit-vector.

References m_sizeInBits.

◆ GetSizeInBytes()

int XrdFileCache::Info::GetSizeInBytes ( ) const
inline

Get size of download-state bit-vector in bytes.

References m_sizeInBits.

Referenced by SetBitPrefetch(), SetBitSynced(), SetBitWritten(), TestBit(), and TestPrefetchBit().

◆ GetTrace()

XrdSysTrace* XrdFileCache::Info::GetTrace ( ) const
inline

References m_trace.

◆ GetVersion()

int XrdFileCache::Info::GetVersion ( )
inline

Get version.

References m_store, and XrdFileCache::Info::Store::m_version.

◆ IsAnythingEmptyInRng()

bool XrdFileCache::Info::IsAnythingEmptyInRng ( int  firstIdx,
int  lastIdx 
) const
inline

Check download status in given block range.

References TestBit().

Referenced by UpdateDownloadCompleteStatus().

◆ IsComplete()

bool XrdFileCache::Info::IsComplete ( ) const
inline

Get complete status.

References m_complete.

◆ Read()

bool XrdFileCache::Info::Read ( XrdOssDF fp,
const std::string &  fname = "<unknown>" 
)

Rea load content from cinfo file into this object.

Parameters
fpfile handle
fnameoptional file name for trace output
Returns
true on success

◆ ReadV1()

bool XrdFileCache::Info::ReadV1 ( XrdOssDF fp,
const std::string &  fname 
)
private

◆ RefStoredData()

const Store& XrdFileCache::Info::RefStoredData ( ) const
inline

Get stored data.

References m_store.

◆ ResetAllAccessStats()

void XrdFileCache::Info::ResetAllAccessStats ( )

Reset IO Stats.

◆ ResizeBits()

void XrdFileCache::Info::ResizeBits ( int  n)

Reserve buffer for fileSize/bufferSize bytes.

Parameters
nnumber of file blocks

◆ SetAllBitsSynced()

void XrdFileCache::Info::SetAllBitsSynced ( )

Mark all blocks as writte.

◆ SetBitPrefetch()

void XrdFileCache::Info::SetBitPrefetch ( int  i)
inline

Mark block as written from prefetchxs.

Parameters
iblock index

References cfiBIT(), GetSizeInBytes(), and m_buff_prefetch.

◆ SetBitSynced()

void XrdFileCache::Info::SetBitSynced ( int  i)
inline

Mark block as disk written.

Parameters
iblock index

References cfiBIT(), GetSizeInBytes(), XrdFileCache::Info::Store::m_buff_synced, and m_store.

◆ SetBitWritten()

void XrdFileCache::Info::SetBitWritten ( int  i)
inline

Mark block as downloaded.

Parameters
iblock index

References cfiBIT(), GetSizeInBytes(), and m_buff_written.

◆ SetBufferSize()

void XrdFileCache::Info::SetBufferSize ( long long  )

◆ SetFileSize()

void XrdFileCache::Info::SetFileSize ( long long  )

◆ TestBit()

bool XrdFileCache::Info::TestBit ( int  i) const
inline

Test if block at the given index is downlaoded.

References cfiBIT(), GetSizeInBytes(), and m_buff_written.

Referenced by GetLastDownloadedBlock(), GetNDownloadedBlocks(), and IsAnythingEmptyInRng().

◆ TestPrefetchBit()

bool XrdFileCache::Info::TestPrefetchBit ( int  i) const
inline

Test if block at the given index is prewritten.

References cfiBIT(), GetSizeInBytes(), and m_buff_prefetch.

◆ UpdateDownloadCompleteStatus()

void XrdFileCache::Info::UpdateDownloadCompleteStatus ( )
inline

Update complete status.

References IsAnythingEmptyInRng(), m_complete, and m_sizeInBits.

◆ Write()

bool XrdFileCache::Info::Write ( XrdOssDF fp,
const std::string &  fname = "<unknown>" 
)

Write number of blocks and read buffer size

Returns
true on success

◆ WriteIOStat()

void XrdFileCache::Info::WriteIOStat ( Stats s)

Write bytes missed, hits, and disk.

◆ WriteIOStatAttach()

void XrdFileCache::Info::WriteIOStatAttach ( )

Write open time in the last entry of access statistics.

◆ WriteIOStatDetach()

void XrdFileCache::Info::WriteIOStatDetach ( Stats s)

Write close time together with bytes missed, hits, and disk.

◆ WriteIOStatSingle() [1/2]

void XrdFileCache::Info::WriteIOStatSingle ( long long  bytes_disk)

Write single open/close time for given bytes read from disk.

◆ WriteIOStatSingle() [2/2]

void XrdFileCache::Info::WriteIOStatSingle ( long long  bytes_disk,
time_t  att,
time_t  dtc 
)

Write open/close with given time and bytes read from disk.

Member Data Documentation

◆ m_buff_prefetch

unsigned char* XrdFileCache::Info::m_buff_prefetch
protected

prefetch statistics

Referenced by SetBitPrefetch(), and TestPrefetchBit().

◆ m_buff_written

unsigned char* XrdFileCache::Info::m_buff_written
protected

download state vector

Referenced by SetBitWritten(), and TestBit().

◆ m_cksCalc

XrdCksCalc* XrdFileCache::Info::m_cksCalc
private

◆ m_complete

bool XrdFileCache::Info::m_complete
protected

cached

Referenced by IsComplete(), and UpdateDownloadCompleteStatus().

◆ m_defaultVersion

const int XrdFileCache::Info::m_defaultVersion
static

◆ m_hasPrefetchBuffer

bool XrdFileCache::Info::m_hasPrefetchBuffer
protected

constains current prefetch score

◆ m_infoExtension

const char* XrdFileCache::Info::m_infoExtension
static

◆ m_maxNumAccess

const size_t XrdFileCache::Info::m_maxNumAccess
static

Referenced by GetMaxNumAccess().

◆ m_sizeInBits

int XrdFileCache::Info::m_sizeInBits
protected

◆ m_store

Store XrdFileCache::Info::m_store
protected

◆ m_trace

XrdSysTrace* XrdFileCache::Info::m_trace
protected

Referenced by GetTrace().

◆ m_traceID

const char* XrdFileCache::Info::m_traceID
static

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