|
xrootd
|
#include <XrdClientReadCache.hh>

Public Types | |
| enum | { kRmBlk_LRU = 0, kRmBlk_LeastOffs, kRmBlk_FIFO } |
Public Member Functions | |
| XrdClientReadCache () | |
| ~XrdClientReadCache () | |
| long | GetDataIfPresent (const void *buffer, long long begin_offs, long long end_offs, bool PerfCalc, XrdClientIntvList &missingblks, long &outstandingblks) |
| void | GetInfo (int &size, long long &bytessubmitted, long long &byteshit, long long &misscount, float &missrate, long long &readreqcnt, float &bytesusefulness) |
| long long | GetTotalByteCount () |
| void | PutPlaceholder (long long begin_offs, long long end_offs) |
| void | PrintPerfCounters () |
| void | PrintCache () |
| void | SubmitXMessage (XrdClientMessage *xmsg, long long begin_offs, long long end_offs) |
| bool | SubmitRawData (const void *buffer, long long begin_offs, long long end_offs, bool pinned=false) |
| void | RemoveItems (bool leavepinned=true) |
| void | RemoveItems (long long begin_offs, long long end_offs, bool remove_overlapped=false) |
| void | RemovePlaceholders () |
| void | SetSize (int sz) |
| void | SetBlkRemovalPolicy (int p) |
| void | UnPinCacheBlk (long long begin_offs, long long end_offs) |
| void * | FindBlk (long long begin_offs, long long end_offs) |
| bool | WillFit (long long bc) |
Private Member Functions | |
| long long | GetTimestampTick () |
| bool | MakeFreeSpace (long long bytes) |
| bool | RemoveItem () |
| bool | RemoveLRUItem () |
| bool | RemoveFirstItem () |
| void | UpdatePerfCounters () |
| int | FindInsertionApprox (long long begin_offs) |
| int | FindInsertionApprox_rec (int startidx, int endidx, long long begin_offs) |
Private Attributes | |
| long long | fBytesHit |
| long long | fBytesSubmitted |
| float | fBytesUsefulness |
| ItemVect | fItems |
| long long | fMaxCacheSize |
| long long | fMissCount |
| float | fMissRate |
| XrdSysRecMutex | fMutex |
| long long | fReadsCounter |
| int | fBlkRemPolicy |
| long long | fTimestampTickCounter |
| long long | fTotalByteCount |
| XrdClientReadCache::XrdClientReadCache | ( | ) |
| XrdClientReadCache::~XrdClientReadCache | ( | ) |
References RemoveItems().
| void * XrdClientReadCache::FindBlk | ( | long long | begin_offs, |
| long long | end_offs | ||
| ) |
References fMutex, FindInsertionApprox(), fItems, and XrdClientVector::GetSize().
Referenced by XrdClientConn::DoWriteSoftCheckPoint().
| int XrdClientReadCache::FindInsertionApprox | ( | long long | begin_offs | ) | [private] |
References fItems, XrdClientVector::GetSize(), and FindInsertionApprox_rec().
Referenced by SubmitRawData(), PutPlaceholder(), GetDataIfPresent(), FindBlk(), UnPinCacheBlk(), and RemoveItems().
| int XrdClientReadCache::FindInsertionApprox_rec | ( | int | startidx, |
| int | endidx, | ||
| long long | begin_offs | ||
| ) | [private] |
References fItems.
Referenced by FindInsertionApprox().
| long XrdClientReadCache::GetDataIfPresent | ( | const void * | buffer, |
| long long | begin_offs, | ||
| long long | end_offs, | ||
| bool | PerfCalc, | ||
| XrdClientIntvList & | missingblks, | ||
| long & | outstandingblks | ||
| ) |
References XrdClientVector::Clear(), fMutex, fReadsCounter, FindInsertionApprox(), fItems, XrdClientVector::GetSize(), fBlkRemPolicy, kRmBlk_FIFO, GetTimestampTick(), xrdmax, fBytesHit, UpdatePerfCounters(), XrdClientCacheInterval::beginoffs, XrdClientCacheInterval::endoffs, XrdClientVector::Push_back(), and fMissCount.
Referenced by XrdClientConn::GetDataFromCache().
| void XrdClientReadCache::GetInfo | ( | int & | size, |
| long long & | bytessubmitted, | ||
| long long & | byteshit, | ||
| long long & | misscount, | ||
| float & | missrate, | ||
| long long & | readreqcnt, | ||
| float & | bytesusefulness | ||
| ) |
References fMaxCacheSize, fBytesSubmitted, fBytesHit, fMissCount, fMissRate, fReadsCounter, and fBytesUsefulness.
Referenced by XrdClientConn::GetCacheInfo().
| long long XrdClientReadCache::GetTimestampTick | ( | ) | [private] |
References fMutex, and fTimestampTickCounter.
Referenced by SubmitRawData(), PutPlaceholder(), and GetDataIfPresent().
| long long XrdClientReadCache::GetTotalByteCount | ( | ) | [inline] |
References fMutex, and fTotalByteCount.
| bool XrdClientReadCache::MakeFreeSpace | ( | long long | bytes | ) | [private] |
References WillFit(), fMutex, fMaxCacheSize, fTotalByteCount, and RemoveItem().
Referenced by SubmitRawData().
| void XrdClientReadCache::PrintCache | ( | ) |
References fMutex, Info, XrdClientDebug::kUSERDEBUG, fItems, XrdClientVector::GetSize(), and fTotalByteCount.
Referenced by XrdClientConn::Disconnect(), and XrdClientConn::PrintCache().
| void XrdClientReadCache::PrintPerfCounters | ( | ) | [inline] |
References fMutex, fMissRate, fMissCount, fReadsCounter, fBytesUsefulness, fBytesSubmitted, and fBytesHit.
Referenced by XrdClientConn::~XrdClientConn().
| void XrdClientReadCache::PutPlaceholder | ( | long long | begin_offs, |
| long long | end_offs | ||
| ) |
References fMutex, FindInsertionApprox(), fItems, XrdClientVector::GetSize(), GetTimestampTick(), and XrdClientVector::Insert().
Referenced by XrdClientConn::SubmitPlaceholderToCache(), and RemoveItems().
| bool XrdClientReadCache::RemoveFirstItem | ( | ) | [private] |
References fMutex, fItems, XrdClientVector::GetSize(), fTotalByteCount, XrdClientReadCacheItem::Size(), and XrdClientVector::Erase().
Referenced by RemoveItem().
| bool XrdClientReadCache::RemoveItem | ( | ) | [private] |
References fBlkRemPolicy, kRmBlk_LRU, kRmBlk_FIFO, RemoveLRUItem(), kRmBlk_LeastOffs, and RemoveFirstItem().
Referenced by MakeFreeSpace().
| void XrdClientReadCache::RemoveItems | ( | bool | leavepinned = true | ) |
References fMutex, fItems, XrdClientVector::GetSize(), fTotalByteCount, and XrdClientVector::Erase().
Referenced by XrdClientConn::RemoveAllDataFromCache(), XrdClientConn::RemoveDataFromCache(), ~XrdClientReadCache(), and SubmitRawData().
| void XrdClientReadCache::RemoveItems | ( | long long | begin_offs, |
| long long | end_offs, | ||
| bool | remove_overlapped = false |
||
| ) |
References fMutex, FindInsertionApprox(), fItems, XrdClientVector::GetSize(), fTotalByteCount, XrdClientVector::Erase(), PutPlaceholder(), and xrdmax.
| bool XrdClientReadCache::RemoveLRUItem | ( | ) | [private] |
References fMutex, fItems, XrdClientVector::GetSize(), fTotalByteCount, XrdClientReadCacheItem::Size(), and XrdClientVector::Erase().
Referenced by RemoveItem().
| void XrdClientReadCache::RemovePlaceholders | ( | ) |
References fMutex, fItems, XrdClientVector::GetSize(), and XrdClientVector::Erase().
Referenced by XrdClientConn::HandleServerError(), and XrdClientConn::RemovePlaceholdersFromCache().
| void XrdClientReadCache::SetBlkRemovalPolicy | ( | int | p | ) | [inline] |
References fBlkRemPolicy.
Referenced by XrdClientConn::SetCacheRmPolicy().
| void XrdClientReadCache::SetSize | ( | int | sz | ) | [inline] |
References fMaxCacheSize.
Referenced by XrdClientConn::SetCacheSize().
| bool XrdClientReadCache::SubmitRawData | ( | const void * | buffer, |
| long long | begin_offs, | ||
| long long | end_offs, | ||
| bool | pinned = false |
||
| ) |
References Info, XrdClientDebug::kHIDEBUG, fMutex, RemoveItems(), MakeFreeSpace(), FindInsertionApprox(), fItems, XrdClientVector::GetSize(), GetTimestampTick(), XrdClientReadCacheItem::Pinned, XrdClientVector::Insert(), fTotalByteCount, XrdClientReadCacheItem::Size(), and fBytesSubmitted.
Referenced by XrdClientConn::SubmitRawDataToCache(), XrdClientConn::WriteToServer_Async(), and SubmitXMessage().
| void XrdClientReadCache::SubmitXMessage | ( | XrdClientMessage * | xmsg, |
| long long | begin_offs, | ||
| long long | end_offs | ||
| ) |
References XrdClientMessage::DonateData(), and SubmitRawData().
Referenced by XrdClientConn::ClientServerCmd(), and XrdClientConn::SubmitDataToCache().
| void XrdClientReadCache::UnPinCacheBlk | ( | long long | begin_offs, |
| long long | end_offs | ||
| ) |
References fMutex, FindInsertionApprox(), fItems, XrdClientVector::GetSize(), and fTotalByteCount.
Referenced by XrdClientConn::UnPinCacheBlk().
| void XrdClientReadCache::UpdatePerfCounters | ( | ) | [inline, private] |
References fReadsCounter, fMissRate, fMissCount, fBytesSubmitted, fBytesUsefulness, and fBytesHit.
Referenced by GetDataIfPresent().
| bool XrdClientReadCache::WillFit | ( | long long | bc | ) | [inline] |
References fMutex, and fMaxCacheSize.
Referenced by XrdClientConn::CacheWillFit(), and MakeFreeSpace().
int XrdClientReadCache::fBlkRemPolicy [private] |
Referenced by XrdClientReadCache(), GetDataIfPresent(), RemoveItem(), and SetBlkRemovalPolicy().
long long XrdClientReadCache::fBytesHit [private] |
Referenced by XrdClientReadCache(), GetDataIfPresent(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
long long XrdClientReadCache::fBytesSubmitted [private] |
Referenced by XrdClientReadCache(), SubmitRawData(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
float XrdClientReadCache::fBytesUsefulness [private] |
Referenced by XrdClientReadCache(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
ItemVect XrdClientReadCache::fItems [private] |
long long XrdClientReadCache::fMaxCacheSize [private] |
Referenced by XrdClientReadCache(), MakeFreeSpace(), GetInfo(), SetSize(), and WillFit().
long long XrdClientReadCache::fMissCount [private] |
Referenced by XrdClientReadCache(), GetDataIfPresent(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
float XrdClientReadCache::fMissRate [private] |
Referenced by XrdClientReadCache(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
XrdSysRecMutex XrdClientReadCache::fMutex [private] |
long long XrdClientReadCache::fReadsCounter [private] |
Referenced by XrdClientReadCache(), GetDataIfPresent(), GetInfo(), UpdatePerfCounters(), and PrintPerfCounters().
long long XrdClientReadCache::fTimestampTickCounter [private] |
Referenced by GetTimestampTick(), and XrdClientReadCache().
long long XrdClientReadCache::fTotalByteCount [private] |
1.7.5