1 #ifndef __XRDPFC_INFO_HH__
2 #define __XRDPFC_INFO_HH__
46 int f_cksum_check : 3;
147 bool Read(
XrdOssDF* fp,
const char *dname,
const char *fname = 0);
156 bool Write(
XrdOssDF* fp,
const char *dname,
const char *fname = 0);
304 #ifdef XRDPFC_CKSUM_TEST
305 static void TestCksumStuff();
332 inline unsigned char cfiBIT(
int n)
const {
return 1 << n; }
335 bool ReadV2(
XrdOssDF* fp, off_t off,
const char *dname,
const char *fname);
336 bool ReadV3(
XrdOssDF* fp, off_t off,
const char *dname,
const char *fname);
348 const int off = i - cn*8;
357 const int off = i - cn*8;
372 const int off = i - cn*8;
383 const int off = i - cn*8;
392 const int off = i - cn*8;
457 for (
int i = firstIdx; i < lastIdx; ++i)
Status of cached file. Can be read from and written into a binary file.
void SetBitPrefetch(int i)
Mark block as obtained through prefetch.
void UpdateDownloadCompleteStatus()
Update complete status.
static const char * s_infoExtension
uint32_t CalcCksumStore()
Get cksum, MD5 is for backward compatibility with V2 and V3.
void ResizeBits()
Reserve bit vectors for file_size / buffer_size bytes.
static const int s_defaultVersion
void SetBitSynced(int i)
Mark block as synced to disk.
void WriteIOStatSingle(long long bytes_disk)
Write single open/close time for given bytes read from disk.
Info(XrdSysTrace *trace, bool prefetchBuffer=false)
Constructor.
int GetBitvecSizeInBytes() const
Get size of download-state bit-vector in bytes.
time_t GetNoCkSumTimeForUVKeep() const
unsigned char * m_buff_prefetch
prefetch statistics
static const size_t s_infoExtensionLen
CkSumCheck_e GetCkSumState() const
const AStat * GetLastAccessStats() const
Get latest access stats.
void WriteIOStatAttach()
Write open time in the last entry of access statistics.
bool GetLatestDetachTime(time_t &t) const
Get latest detach time.
bool Write(XrdOssDF *fp, const char *dname, const char *fname=0)
void DowngradeCkSumState(CkSumCheck_e css_ref)
long long GetNDownloadedBytes() const
Get number of downloaded bytes.
void CompactifyAccessRecords()
Compactify access records to the configured maximum.
int GetLastDownloadedBlock() const
Get number of the last downloaded block.
uint32_t CalcCksumSyncedAndAStats()
time_t GetCreationTime() const
Get file size.
unsigned char * m_buff_written
download state vector
unsigned char * m_buff_synced
disk written state vector
bool m_complete
cached; if false, set to true when missingBlocks hit zero
void ResetAllAccessStats()
Reset IO Stats.
bool TestBitPrefetch(int i) const
Test if block at the given index has been prefetched.
bool IsComplete() const
Get complete status.
const std::vector< AStat > & RefAStats() const
bool IsCkSumCache() const
const Store & RefStoredData() const
Get stored data.
void SetBitWritten(int i)
Mark block as written to disk.
time_t GetNoCkSumTime() const
int m_missingBlocks
cached, updated in SetBitWritten()
long long GetBufferSize() const
Get prefetch buffer size.
void WriteIOStat(Stats &s)
Write bytes missed, hits, and disk.
long long GetExpectedDataFileSize() const
Get expected data file size.
bool TestBitWritten(int i) const
Test if block at the given index is written to disk.
int m_bitvecSizeInBits
cached
long long GetFileSize() const
Get file size.
std::vector< AStat > m_astats
access records
void SetAllBitsSynced()
Mark all blocks as synced to disk.
bool Read(XrdOssDF *fp, const char *dname, const char *fname=0)
Read content of cinfo file into this object.
XrdSysTrace * GetTrace() const
void SetCkSumState(CkSumCheck_e css)
const char * GetCkSumStateAsText() const
int GetVersion()
Get version.
int GetNDownloadedBlocks() const
Get number of downloaded blocks.
size_t GetAccessCnt() const
Get number of accesses.
int CountBlocksNotWrittenInRng(int firstIdx, int lastIdx) const
Check download status in given block range.
void SetBufferSizeFileSizeAndCreationTime(long long bs, long long fs)
void WriteIOStatDetach(Stats &s)
Write close time together with bytes missed, hits, and disk.
static size_t s_maxNumAccess
static const char * m_traceID
void CalcCksumMd5(unsigned char *buff, char *digest)
int GetNBlocks() const
Get number of blocks represented in download-state bit-vector.
bool m_hasPrefetchBuffer
constains current prefetch score
bool HasNoCkSumTime() const
Statistics of cache utilisation by a File object.
long long BytesHit
read from cache
long long BytesBypassed
read from remote and dropped
void MergeWith(const AStat &a)
int Duration
total duration of all IOs attached
int Reserved
reserved / alignment
int NumIos
number of IO objects attached during this access
time_t DetachTime
close time
long long BytesMissed
read from remote and cached
time_t AttachTime
open time
int NumMerged
number of times the record has been merged
int m_astatSize
size of AStat vector
Status m_status
status information
long long m_buffer_size
buffer / block size
time_t m_noCkSumTime
time when first non-cksummed block was detected
size_t m_accessCnt
total access count for the file
long long m_file_size
size of file in bytes
time_t m_creationTime
time the info file was created