xrootd
Loading...
Searching...
No Matches
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  Status
 
struct  Store
 

Public Member Functions

 Info (XrdSysTrace *trace, bool prefetchBuffer=false)
 Constructor.
 
 ~Info ()
 Destructor.
 
void SetBitWritten (int i)
 Mark block as written to disk.
 
bool TestBitWritten (int i) const
 Test if block at the given index is written to disk.
 
bool TestBitPrefetch (int i) const
 Test if block at the given index has been prefetched.
 
void SetBitPrefetch (int i)
 Mark block as obtained through prefetch.
 
void SetBitSynced (int i)
 Mark block as synced to disk.
 
void SetAllBitsSynced ()
 Mark all blocks as synced to disk.
 
void SetBufferSizeFileSizeAndCreationTime (long long bs, long long fs)
 
void ResizeBits ()
 Reserve bit vectors for file_size / buffer_size bytes.
 
bool Read (XrdOssDF *fp, const char *dname, const char *fname=0)
 Read content of cinfo file into this object.
 
bool Write (XrdOssDF *fp, const char *dname, const char *fname=0)
 
void CompactifyAccessRecords ()
 Compactify access records to the configured maximum.
 
void ResetAllAccessStats ()
 Reset IO Stats.
 
void WriteIOStatAttach ()
 Write open time in the last entry of access statistics.
 
void WriteIOStat (Stats &s)
 Write bytes missed, hits, and disk.
 
void WriteIOStatDetach (Stats &s)
 Write close time together with bytes missed, hits, and disk.
 
void WriteIOStatSingle (long long bytes_disk)
 Write single open/close time for given bytes read from disk.
 
void WriteIOStatSingle (long long bytes_disk, time_t att, time_t dtc)
 Write open/close with given time and bytes read from disk.
 
int CountBlocksNotWrittenInRng (int firstIdx, int lastIdx) const
 Check download status in given block range.
 
int GetBitvecSizeInBytes () const
 Get size of download-state bit-vector in bytes.
 
int GetNBlocks () const
 Get number of blocks represented in download-state bit-vector.
 
long long GetFileSize () const
 Get file size.
 
bool GetLatestDetachTime (time_t &t) const
 Get latest detach time.
 
const AStatGetLastAccessStats () const
 Get latest access stats.
 
long long GetBufferSize () const
 Get prefetch buffer size.
 
bool IsComplete () const
 Get complete status.
 
int GetNDownloadedBlocks () const
 Get number of downloaded blocks.
 
long long GetNDownloadedBytes () const
 Get number of downloaded bytes.
 
int GetLastDownloadedBlock () const
 Get number of the last downloaded block.
 
long long GetExpectedDataFileSize () const
 Get expected data file size.
 
void UpdateDownloadCompleteStatus ()
 Update complete status.
 
size_t GetAccessCnt () const
 Get number of accesses.
 
int GetVersion ()
 Get version.
 
const StoreRefStoredData () const
 Get stored data.
 
const std::vector< AStat > & RefAStats () const
 
time_t GetCreationTime () const
 Get file size.
 
uint32_t CalcCksumStore ()
 Get cksum, MD5 is for backward compatibility with V2 and V3.
 
uint32_t CalcCksumSyncedAndAStats ()
 
void CalcCksumMd5 (unsigned char *buff, char *digest)
 
CkSumCheck_e GetCkSumState () const
 
const char * GetCkSumStateAsText () const
 
bool IsCkSumCache () const
 
bool IsCkSumNet () const
 
bool IsCkSumAny () const
 
bool IsCkSumBoth () const
 
void SetCkSumState (CkSumCheck_e css)
 
void DowngradeCkSumState (CkSumCheck_e css_ref)
 
void ResetCkSumCache ()
 
void ResetCkSumNet ()
 
bool HasNoCkSumTime () const
 
time_t GetNoCkSumTime () const
 
time_t GetNoCkSumTimeForUVKeep () const
 
void ResetNoCkSumTime ()
 
XrdSysTraceGetTrace () const
 

Static Public Attributes

static const char * m_traceID
 
static const char * s_infoExtension
 
static const size_t s_infoExtensionLen
 
static size_t s_maxNumAccess
 
static const int s_defaultVersion
 

Protected Attributes

XrdSysTracem_trace
 
Store m_store
 
unsigned char * m_buff_synced
 disk written state vector
 
unsigned char * m_buff_written
 download state vector
 
unsigned char * m_buff_prefetch
 prefetch statistics
 
std::vector< AStatm_astats
 access records
 
int m_version
 
int m_bitvecSizeInBits
 cached
 
int m_missingBlocks
 cached, updated in SetBitWritten()
 
bool m_complete
 cached; if false, set to true when missingBlocks hit zero
 
bool m_hasPrefetchBuffer
 constains current prefetch score
 

Private Member Functions

unsigned char cfiBIT (int n) const
 
bool ReadV2 (XrdOssDF *fp, off_t off, const char *dname, const char *fname)
 
bool ReadV3 (XrdOssDF *fp, off_t off, const char *dname, const char *fname)
 

Private Attributes

XrdCksCalcm_cksCalcMd5
 

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

◆ CalcCksumMd5()

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

◆ CalcCksumStore()

uint32_t XrdPfc::Info::CalcCksumStore ( )

Get cksum, MD5 is for backward compatibility with V2 and V3.

◆ CalcCksumSyncedAndAStats()

uint32_t XrdPfc::Info::CalcCksumSyncedAndAStats ( )

◆ cfiBIT()

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

◆ CompactifyAccessRecords()

void XrdPfc::Info::CompactifyAccessRecords ( )

Compactify access records to the configured maximum.

◆ CountBlocksNotWrittenInRng()

int XrdPfc::Info::CountBlocksNotWrittenInRng ( int  firstIdx,
int  lastIdx 
) const
inline

Check download status in given block range.

References TestBitWritten().

Referenced by UpdateDownloadCompleteStatus().

◆ DowngradeCkSumState()

void XrdPfc::Info::DowngradeCkSumState ( CkSumCheck_e  css_ref)
inline

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

◆ GetBitvecSizeInBytes()

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

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

References m_bitvecSizeInBits.

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

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

◆ GetCkSumState()

CkSumCheck_e XrdPfc::Info::GetCkSumState ( ) const
inline

◆ GetCkSumStateAsText()

const char * XrdPfc::Info::GetCkSumStateAsText ( ) const

◆ GetCreationTime()

time_t XrdPfc::Info::GetCreationTime ( ) const
inline

Get file size.

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

◆ 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_bitvecSizeInBits, and TestBitWritten().

Referenced by GetExpectedDataFileSize().

◆ GetLatestDetachTime()

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

Get latest detach time.

◆ GetNBlocks()

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

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

References m_bitvecSizeInBits.

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

◆ GetNDownloadedBlocks()

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

Get number of downloaded blocks.

References m_bitvecSizeInBits, 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.

◆ GetNoCkSumTime()

time_t XrdPfc::Info::GetNoCkSumTime ( ) const
inline

◆ GetNoCkSumTimeForUVKeep()

time_t XrdPfc::Info::GetNoCkSumTimeForUVKeep ( ) const
inline

◆ GetTrace()

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

References m_trace.

◆ GetVersion()

int XrdPfc::Info::GetVersion ( )
inline

Get version.

References m_version.

◆ HasNoCkSumTime()

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

◆ IsCkSumAny()

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

◆ IsCkSumBoth()

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

◆ IsCkSumCache()

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

◆ IsCkSumNet()

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

◆ IsComplete()

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

Get complete status.

References m_complete.

◆ Read()

bool XrdPfc::Info::Read ( XrdOssDF fp,
const char *  dname,
const char *  fname = 0 
)

Read content of cinfo file into this object.

Parameters
fpfile handle
dnamedirectory name for trace output
fnameoptional file name for trace output (can be included in dname)
Returns
true on success

◆ ReadV2()

bool XrdPfc::Info::ReadV2 ( XrdOssDF fp,
off_t  off,
const char *  dname,
const char *  fname 
)
private

◆ ReadV3()

bool XrdPfc::Info::ReadV3 ( XrdOssDF fp,
off_t  off,
const char *  dname,
const char *  fname 
)
private

◆ RefAStats()

const std::vector< AStat > & XrdPfc::Info::RefAStats ( ) const
inline

References m_astats.

◆ RefStoredData()

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

Get stored data.

References m_store.

◆ ResetAllAccessStats()

void XrdPfc::Info::ResetAllAccessStats ( )

Reset IO Stats.

◆ ResetCkSumCache()

void XrdPfc::Info::ResetCkSumCache ( )

◆ ResetCkSumNet()

void XrdPfc::Info::ResetCkSumNet ( )

◆ ResetNoCkSumTime()

void XrdPfc::Info::ResetNoCkSumTime ( )
inline

◆ ResizeBits()

void XrdPfc::Info::ResizeBits ( )

Reserve bit vectors for file_size / buffer_size bytes.

◆ 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(), GetBitvecSizeInBytes(), and m_buff_prefetch.

◆ SetBitSynced()

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

Mark block as synced to disk.

References cfiBIT(), GetBitvecSizeInBytes(), and m_buff_synced.

◆ SetBitWritten()

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

Mark block as written to disk.

References cfiBIT(), GetBitvecSizeInBytes(), m_buff_written, m_complete, and m_missingBlocks.

◆ SetBufferSizeFileSizeAndCreationTime()

void XrdPfc::Info::SetBufferSizeFileSizeAndCreationTime ( long long  bs,
long long  fs 
)

◆ SetCkSumState()

void XrdPfc::Info::SetCkSumState ( CkSumCheck_e  css)
inline

◆ TestBitPrefetch()

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

Test if block at the given index has been prefetched.

References cfiBIT(), GetBitvecSizeInBytes(), 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(), GetBitvecSizeInBytes(), and m_buff_written.

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

◆ UpdateDownloadCompleteStatus()

void XrdPfc::Info::UpdateDownloadCompleteStatus ( )
inline

Update complete status.

References CountBlocksNotWrittenInRng(), m_bitvecSizeInBits, m_complete, and m_missingBlocks.

◆ Write()

bool XrdPfc::Info::Write ( XrdOssDF fp,
const char *  dname,
const char *  fname = 0 
)

Write number of blocks and read buffer size

Parameters
fpfile handle
dnamedirectory name for trace output
fnameoptional file name for trace output (can be included in dname)
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_astats

std::vector<AStat> XrdPfc::Info::m_astats
protected

access records

Referenced by RefAStats().

◆ m_bitvecSizeInBits

int XrdPfc::Info::m_bitvecSizeInBits
protected

◆ m_buff_prefetch

unsigned char* XrdPfc::Info::m_buff_prefetch
protected

prefetch statistics

Referenced by SetBitPrefetch(), and TestBitPrefetch().

◆ m_buff_synced

unsigned char* XrdPfc::Info::m_buff_synced
protected

disk written state vector

Referenced by SetBitSynced().

◆ m_buff_written

unsigned char* XrdPfc::Info::m_buff_written
protected

download state vector

Referenced by SetBitWritten(), and TestBitWritten().

◆ m_cksCalcMd5

XrdCksCalc* XrdPfc::Info::m_cksCalcMd5
private

◆ m_complete

bool XrdPfc::Info::m_complete
protected

cached; if false, set to true when missingBlocks hit zero

Referenced by IsComplete(), SetBitWritten(), and UpdateDownloadCompleteStatus().

◆ m_hasPrefetchBuffer

bool XrdPfc::Info::m_hasPrefetchBuffer
protected

constains current prefetch score

◆ m_missingBlocks

int XrdPfc::Info::m_missingBlocks
protected

cached, updated in SetBitWritten()

Referenced by SetBitWritten(), and UpdateDownloadCompleteStatus().

◆ 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

◆ m_version

int XrdPfc::Info::m_version
protected

Referenced by GetVersion().

◆ s_defaultVersion

const int XrdPfc::Info::s_defaultVersion
static

◆ s_infoExtension

const char* XrdPfc::Info::s_infoExtension
static

◆ s_infoExtensionLen

const size_t XrdPfc::Info::s_infoExtensionLen
static

◆ s_maxNumAccess

size_t XrdPfc::Info::s_maxNumAccess
static

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