Status of cached file. Can be read from and written into a binary file. More...
#include <XrdFileCacheInfo.hh>
Classes | |
struct | AStat |
Public Member Functions | |
Info (long long bufferSize) | |
Constructor. | |
~Info () | |
Destructor. | |
void | SetBitFetched (int i) |
Mark block as downloaded. | |
void | SetBitWriteCalled (int i) |
Mark block as disk written. | |
void | ResizeBits (int n) |
Reserve buffer for fileSize/bufferSize bytes. | |
int | Read (XrdOssDF *fp) |
Rea load content from cinfo file into this object. | |
void | WriteHeader (XrdOssDF *fp) |
Write number of blocks and prefetch buffer size. | |
void | AppendIOStat (AStat &stat, XrdOssDF *fp) |
Append access time, and cache statistics. | |
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. | |
int | GetHeaderSize () const |
Get header size. | |
bool | GetLatestDetachTime (time_t &t, XrdOssDF *fp) const |
Get latest detach time. | |
long long | GetBufferSize () const |
Get prefetch buffer size. | |
bool | TestBit (int i) const |
Test if block at the given index is downlaoded. | |
bool | IsComplete () const |
Get complete status. | |
int | GetNDownloadedBlocks () const |
Get number of downloaded blocks. | |
long long | GetNDownloadedBytes () const |
Get number of downloaded bytes. | |
void | CheckComplete () |
Update complete status. | |
int | GetAccessCnt () |
Get number of accesses. | |
int | GetVersion () |
Get version. | |
Static Public Attributes | |
static const char * | m_infoExtension |
Protected Member Functions | |
XrdCl::Log * | clLog () const |
Protected Attributes | |
int | m_version |
Cache statistics and time of access. | |
long long | m_bufferSize |
prefetch buffer size | |
int | m_sizeInBits |
number of file blocks | |
unsigned char * | m_buff_fetched |
download state vector | |
unsigned char * | m_buff_write_called |
disk written state vector | |
int | m_accessCnt |
number of written AStat structs | |
bool | m_complete |
cached | |
Static Private Member Functions | |
static unsigned char | cfiBIT (int n) |
Status of cached file. Can be read from and written into a binary file.
XrdFileCache::Info::Info | ( | long long | bufferSize | ) |
Constructor.
XrdFileCache::Info::~Info | ( | ) |
Destructor.
Append access time, and cache statistics.
static unsigned char XrdFileCache::Info::cfiBIT | ( | int | n | ) | [inline, static, private] |
Referenced by SetBitFetched(), SetBitWriteCalled(), and TestBit().
void XrdFileCache::Info::CheckComplete | ( | ) | [inline] |
Update complete status.
References IsAnythingEmptyInRng(), m_complete, and m_sizeInBits.
XrdCl::Log* XrdFileCache::Info::clLog | ( | ) | const [inline, protected] |
References XrdCl::DefaultEnv::GetLog().
int XrdFileCache::Info::GetAccessCnt | ( | ) | [inline] |
Get number of accesses.
References m_accessCnt.
long long XrdFileCache::Info::GetBufferSize | ( | ) | const [inline] |
Get prefetch buffer size.
References m_bufferSize.
int XrdFileCache::Info::GetHeaderSize | ( | ) | const |
Get header size.
bool XrdFileCache::Info::GetLatestDetachTime | ( | time_t & | t, | |
XrdOssDF * | fp | |||
) | const |
Get latest detach time.
int XrdFileCache::Info::GetNDownloadedBlocks | ( | ) | const [inline] |
Get number of downloaded blocks.
References m_sizeInBits, and TestBit().
Referenced by GetNDownloadedBytes().
long long XrdFileCache::Info::GetNDownloadedBytes | ( | ) | const [inline] |
Get number of downloaded bytes.
References GetNDownloadedBlocks(), and m_bufferSize.
int XrdFileCache::Info::GetSizeInBits | ( | ) | const [inline] |
Get number of blocks represented in download-state bit-vector.
References m_sizeInBits.
int XrdFileCache::Info::GetSizeInBytes | ( | ) | const [inline] |
Get size of download-state bit-vector in bytes.
References m_sizeInBits.
Referenced by SetBitFetched(), SetBitWriteCalled(), and TestBit().
int XrdFileCache::Info::GetVersion | ( | ) | [inline] |
Get version.
References m_version.
bool XrdFileCache::Info::IsAnythingEmptyInRng | ( | int | firstIdx, | |
int | lastIdx | |||
) | const [inline] |
bool XrdFileCache::Info::IsComplete | ( | ) | const [inline] |
Get complete status.
References m_complete.
int XrdFileCache::Info::Read | ( | XrdOssDF * | fp | ) |
Rea load content from cinfo file into this object.
fp | file handle |
void XrdFileCache::Info::ResizeBits | ( | int | n | ) |
Reserve buffer for fileSize/bufferSize bytes.
n | number of file blocks |
void XrdFileCache::Info::SetBitFetched | ( | int | i | ) | [inline] |
Mark block as downloaded.
i | block index |
References cfiBIT(), GetSizeInBytes(), and m_buff_fetched.
void XrdFileCache::Info::SetBitWriteCalled | ( | int | i | ) | [inline] |
Mark block as disk written.
i | block index |
References cfiBIT(), GetSizeInBytes(), and m_buff_write_called.
bool XrdFileCache::Info::TestBit | ( | int | i | ) | const [inline] |
Test if block at the given index is downlaoded.
References cfiBIT(), GetSizeInBytes(), and m_buff_fetched.
Referenced by GetNDownloadedBlocks(), and IsAnythingEmptyInRng().
void XrdFileCache::Info::WriteHeader | ( | XrdOssDF * | fp | ) |
Write number of blocks and prefetch buffer size.
int XrdFileCache::Info::m_accessCnt [protected] |
number of written AStat structs
Referenced by GetAccessCnt().
unsigned char* XrdFileCache::Info::m_buff_fetched [protected] |
download state vector
Referenced by SetBitFetched(), and TestBit().
unsigned char* XrdFileCache::Info::m_buff_write_called [protected] |
disk written state vector
Referenced by SetBitWriteCalled().
long long XrdFileCache::Info::m_bufferSize [protected] |
prefetch buffer size
Referenced by GetBufferSize(), and GetNDownloadedBytes().
bool XrdFileCache::Info::m_complete [protected] |
cached
Referenced by CheckComplete(), and IsComplete().
const char* XrdFileCache::Info::m_infoExtension [static] |
int XrdFileCache::Info::m_sizeInBits [protected] |
number of file blocks
Referenced by CheckComplete(), GetNDownloadedBlocks(), GetSizeInBits(), and GetSizeInBytes().
int XrdFileCache::Info::m_version [protected] |