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

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

#include <XrdPfcInfo.hh>

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

Classes

struct  AStat
 Access statistics. More...
 
struct  Store
 

Public Member Functions

 Info (XrdSysTrace *trace, bool prefetchBuffer=false)
 Constructor. More...
 
 ~Info ()
 Destructor. More...
 
void SetBitWritten (int i)
 Mark block as written to disk. More...
 
bool TestBitWritten (int i) const
 Test if block at the given index is written to disk. More...
 
bool TestBitPrefetch (int i) const
 Test if block at the given index has been prefetched. More...
 
void SetBitPrefetch (int i)
 Mark block as obtained through prefetch. More...
 
void SetBitSynced (int i)
 Mark block as synced to disk. More...
 
void SetAllBitsSynced ()
 Mark all blocks as synced to disk. More...
 
void SetBufferSize (long long)
 
void SetFileSize (long long)
 
void ResizeBits (int n)
 Reserve buffer for file_size / buffer_size 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 CompactifyAccessRecords ()
 Compactify access records to the configured maximum. More...
 
void DisableDownloadStatus ()
 Disable allocating, writing, and reading of download 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...
 
const AStatGetLastAccessStats () const
 Get latest access stats. More...
 
long long GetBufferSize () const
 Get prefetch buffer size. 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 () const
 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 Attributes

static const char * m_traceID
 
static const char * s_infoExtension
 
static const int s_defaultVersion
 
static size_t s_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)
 
bool ReadV2 (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()

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

Constructor.

◆ ~Info()

XrdPfc::Info::~Info ( )

Destructor.

Member Function Documentation

◆ cfiBIT()

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

◆ CompactifyAccessRecords()

void XrdPfc::Info::CompactifyAccessRecords ( )

Compactify access records to the configured maximum.

◆ DisableDownloadStatus()

void XrdPfc::Info::DisableDownloadStatus ( )

Disable allocating, writing, and reading of download status.

◆ GetAccessCnt()

size_t XrdPfc::Info::GetAccessCnt ( ) const
inline

Get number of accesses.

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

Referenced by XrdPfc::File::GetAccessCnt().

◆ GetBufferSize()

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

Get prefetch buffer size.

References XrdPfc::Info::Store::m_buffer_size, and m_store.

Referenced by XrdPfc::File::GetBlockSize().

◆ GetCksum()

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

Get md5 cksum.

◆ GetExpectedDataFileSize()

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

◆ GetFileSize()

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

Get file size.

References XrdPfc::Info::Store::m_file_size, and m_store.

◆ GetLastAccessStats()

const AStat* XrdPfc::Info::GetLastAccessStats ( ) const

Get latest access stats.

Referenced by XrdPfc::File::GetLastAccessStats().

◆ GetLastDownloadedBlock()

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

Get number of the last downloaded block.

References m_sizeInBits, and TestBitWritten().

Referenced by GetExpectedDataFileSize().

◆ GetLatestDetachTime()

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

Get latest detach time.

◆ GetNDownloadedBlocks()

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

Get number of downloaded blocks.

References m_sizeInBits, and TestBitWritten().

Referenced by XrdPfc::File::GetNDownloadedBlocks(), and GetNDownloadedBytes().

◆ GetNDownloadedBytes()

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

Get number of downloaded bytes.

References GetNDownloadedBlocks(), XrdPfc::Info::Store::m_buffer_size, and m_store.

◆ GetSizeInBits()

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

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

References m_sizeInBits.

Referenced by XrdPfc::File::GetNBlocks().

◆ GetSizeInBytes()

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

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

References m_sizeInBits.

Referenced by SetBitPrefetch(), SetBitSynced(), SetBitWritten(), TestBitPrefetch(), and TestBitWritten().

◆ GetTrace()

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

References m_trace.

◆ GetVersion()

int XrdPfc::Info::GetVersion ( )
inline

Get version.

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

◆ IsAnythingEmptyInRng()

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

Check download status in given block range.

References TestBitWritten().

Referenced by UpdateDownloadCompleteStatus().

◆ IsComplete()

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

Get complete status.

References m_complete.

◆ Read()

bool XrdPfc::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 XrdPfc::Info::ReadV1 ( XrdOssDF fp,
const std::string &  fname 
)
private

◆ ReadV2()

bool XrdPfc::Info::ReadV2 ( XrdOssDF fp,
const std::string &  fname 
)
private

◆ RefStoredData()

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

Get stored data.

References m_store.

◆ ResetAllAccessStats()

void XrdPfc::Info::ResetAllAccessStats ( )

Reset IO Stats.

◆ ResizeBits()

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

Reserve buffer for file_size / buffer_size bytes.

Parameters
nnumber of file blocks

◆ SetAllBitsSynced()

void XrdPfc::Info::SetAllBitsSynced ( )

Mark all blocks as synced to disk.

◆ SetBitPrefetch()

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

Mark block as obtained through prefetch.

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

◆ SetBitSynced()

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

Mark block as synced to disk.

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

◆ SetBitWritten()

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

Mark block as written to disk.

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

◆ SetBufferSize()

void XrdPfc::Info::SetBufferSize ( long long  )

◆ SetFileSize()

void XrdPfc::Info::SetFileSize ( long long  )

◆ TestBitPrefetch()

bool XrdPfc::Info::TestBitPrefetch ( int  i) const
inline

Test if block at the given index has been prefetched.

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

◆ TestBitWritten()

bool XrdPfc::Info::TestBitWritten ( int  i) const
inline

Test if block at the given index is written to disk.

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

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

◆ UpdateDownloadCompleteStatus()

void XrdPfc::Info::UpdateDownloadCompleteStatus ( )
inline

Update complete status.

References IsAnythingEmptyInRng(), m_complete, and m_sizeInBits.

◆ Write()

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

Write number of blocks and read buffer size

Returns
true on success

◆ WriteIOStat()

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

Write bytes missed, hits, and disk.

◆ WriteIOStatAttach()

void XrdPfc::Info::WriteIOStatAttach ( )

Write open time in the last entry of access statistics.

◆ WriteIOStatDetach()

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

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

◆ WriteIOStatSingle() [1/2]

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

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

◆ WriteIOStatSingle() [2/2]

void XrdPfc::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* XrdPfc::Info::m_buff_prefetch
protected

prefetch statistics

Referenced by SetBitPrefetch(), and TestBitPrefetch().

◆ m_buff_written

unsigned char* XrdPfc::Info::m_buff_written
protected

download state vector

Referenced by SetBitWritten(), and TestBitWritten().

◆ m_cksCalc

XrdCksCalc* XrdPfc::Info::m_cksCalc
private

◆ m_complete

bool XrdPfc::Info::m_complete
protected

cached

Referenced by IsComplete(), and UpdateDownloadCompleteStatus().

◆ m_hasPrefetchBuffer

bool XrdPfc::Info::m_hasPrefetchBuffer
protected

constains current prefetch score

◆ m_sizeInBits

int XrdPfc::Info::m_sizeInBits
protected

◆ m_store

Store XrdPfc::Info::m_store
protected

◆ m_trace

XrdSysTrace* XrdPfc::Info::m_trace
protected

Referenced by GetTrace().

◆ m_traceID

const char* XrdPfc::Info::m_traceID
static

◆ s_defaultVersion

const int XrdPfc::Info::s_defaultVersion
static

◆ s_infoExtension

const char* XrdPfc::Info::s_infoExtension
static

◆ s_maxNumAccess

size_t XrdPfc::Info::s_maxNumAccess
static

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