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]

List of all members.

Classes

struct  AStat
 Access statistics. More...
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 SetBufferSize (long long)
void SetFileSize (long long)
void ResizeBits (int n)
 Reserve buffer for file_size / buffer_size bytes.
bool Read (XrdOssDF *fp, const std::string &fname="<unknown>")
 Rea load content from cinfo file into this object.
bool Write (XrdOssDF *fp, const std::string &fname="<unknown>")
void CompactifyAccessRecords ()
 Compactify access records to the configured maximum.
void DisableDownloadStatus ()
 Disable allocating, writing, and reading of download status.
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.
bool IsAnythingEmptyInRng (int firstIdx, int lastIdx) const
 Check download status in given block range.
int GetSizeInBytes () const
 Get size of download-state bit-vector in bytes.
int GetSizeInBits () 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.
void GetCksum (unsigned char *buff, char *digest)
 Get md5 cksum.
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
unsigned char * m_buff_written
 download state vector
unsigned char * m_buff_prefetch
 prefetch statistics
int m_sizeInBits
 cached
bool m_complete
 cached

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

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

Constructor.

XrdPfc::Info::~Info (  ) 

Destructor.


Member Function Documentation

unsigned char XrdPfc::Info::cfiBIT ( int  n  )  const [inline, private]
void XrdPfc::Info::CompactifyAccessRecords (  ) 

Compactify access records to the configured maximum.

void XrdPfc::Info::DisableDownloadStatus (  ) 

Disable allocating, writing, and reading of download status.

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

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

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

Get md5 cksum.

long long XrdPfc::Info::GetExpectedDataFileSize (  )  const [inline]
long long XrdPfc::Info::GetFileSize (  )  const [inline]

Get file size.

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

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

Get latest access stats.

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

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

Get number of the last downloaded block.

References m_sizeInBits, and TestBitWritten().

Referenced by GetExpectedDataFileSize().

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

Get latest detach time.

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

Get number of downloaded blocks.

References m_sizeInBits, and TestBitWritten().

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

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

Get number of downloaded bytes.

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

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

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

References m_sizeInBits.

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

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

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

References m_trace.

int XrdPfc::Info::GetVersion (  )  [inline]

Get version.

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

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

Check download status in given block range.

References TestBitWritten().

Referenced by UpdateDownloadCompleteStatus().

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

Get complete status.

References m_complete.

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

Rea load content from cinfo file into this object.

Parameters:
fp file handle
fname optional file name for trace output
Returns:
true on success
bool XrdPfc::Info::ReadV1 ( XrdOssDF fp,
const std::string &  fname 
) [private]
bool XrdPfc::Info::ReadV2 ( XrdOssDF fp,
const std::string &  fname 
) [private]
const Store& XrdPfc::Info::RefStoredData (  )  const [inline]

Get stored data.

References m_store.

void XrdPfc::Info::ResetAllAccessStats (  ) 

Reset IO Stats.

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

Reserve buffer for file_size / buffer_size bytes.

Parameters:
n number of file blocks
void XrdPfc::Info::SetAllBitsSynced (  ) 

Mark all blocks as synced to disk.

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

Mark block as obtained through prefetch.

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

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.

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

Mark block as written to disk.

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

void XrdPfc::Info::SetBufferSize ( long  long  ) 
void XrdPfc::Info::SetFileSize ( long  long  ) 
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.

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

void XrdPfc::Info::UpdateDownloadCompleteStatus (  )  [inline]

Update complete status.

References IsAnythingEmptyInRng(), m_complete, and m_sizeInBits.

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

Write number of blocks and read buffer size

Returns:
true on success
void XrdPfc::Info::WriteIOStat ( Stats s  ) 

Write bytes missed, hits, and disk.

void XrdPfc::Info::WriteIOStatAttach (  ) 

Write open time in the last entry of access statistics.

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

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

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.

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

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


Member Data Documentation

unsigned char* XrdPfc::Info::m_buff_prefetch [protected]

prefetch statistics

Referenced by SetBitPrefetch(), and TestBitPrefetch().

unsigned char* XrdPfc::Info::m_buff_written [protected]

download state vector

Referenced by SetBitWritten(), and TestBitWritten().

bool XrdPfc::Info::m_complete [protected]

cached

Referenced by IsComplete(), and UpdateDownloadCompleteStatus().

constains current prefetch score

int XrdPfc::Info::m_sizeInBits [protected]

Referenced by GetTrace().

const char* XrdPfc::Info::m_traceID [static]
const int XrdPfc::Info::s_defaultVersion [static]
const char* XrdPfc::Info::s_infoExtension [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1