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 FindInsertionApprox(), fItems, fMutex, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::DoWriteSoftCheckPoint().
int XrdClientReadCache::FindInsertionApprox | ( | long long | begin_offs | ) | [private] |
References FindInsertionApprox_rec(), fItems, and XrdClientVector< T >::GetSize().
Referenced by FindBlk(), GetDataIfPresent(), PutPlaceholder(), RemoveItems(), SubmitRawData(), and UnPinCacheBlk().
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 XrdClientCacheInterval::beginoffs, XrdClientVector< T >::Clear(), XrdClientCacheInterval::endoffs, fBlkRemPolicy, fBytesHit, FindInsertionApprox(), fItems, fMissCount, fMutex, fReadsCounter, XrdClientVector< T >::GetSize(), GetTimestampTick(), kRmBlk_FIFO, XrdClientVector< T >::Push_back(), UpdatePerfCounters(), and xrdmax.
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 fBytesHit, fBytesSubmitted, fBytesUsefulness, fMaxCacheSize, fMissCount, fMissRate, and fReadsCounter.
Referenced by XrdClientConn::GetCacheInfo().
long long XrdClientReadCache::GetTimestampTick | ( | ) | [private] |
References fMutex, and fTimestampTickCounter.
Referenced by GetDataIfPresent(), PutPlaceholder(), and SubmitRawData().
long long XrdClientReadCache::GetTotalByteCount | ( | ) | [inline] |
References fMutex, and fTotalByteCount.
bool XrdClientReadCache::MakeFreeSpace | ( | long long | bytes | ) | [private] |
References fMaxCacheSize, fMutex, fTotalByteCount, RemoveItem(), and WillFit().
Referenced by SubmitRawData().
void XrdClientReadCache::PrintCache | ( | ) |
References fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), Info, and XrdClientDebug::kUSERDEBUG.
Referenced by XrdClientConn::Disconnect(), and XrdClientConn::PrintCache().
void XrdClientReadCache::PrintPerfCounters | ( | ) | [inline] |
References fBytesHit, fBytesSubmitted, fBytesUsefulness, fMissCount, fMissRate, fMutex, and fReadsCounter.
Referenced by XrdClientConn::~XrdClientConn().
void XrdClientReadCache::PutPlaceholder | ( | long long | begin_offs, |
long long | end_offs | ||
) |
References FindInsertionApprox(), fItems, fMutex, XrdClientVector< T >::GetSize(), GetTimestampTick(), and XrdClientVector< T >::Insert().
Referenced by RemoveItems(), and XrdClientConn::SubmitPlaceholderToCache().
bool XrdClientReadCache::RemoveFirstItem | ( | ) | [private] |
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), and XrdClientReadCacheItem::Size().
Referenced by RemoveItem().
bool XrdClientReadCache::RemoveItem | ( | ) | [private] |
References fBlkRemPolicy, kRmBlk_FIFO, kRmBlk_LeastOffs, kRmBlk_LRU, RemoveFirstItem(), and RemoveLRUItem().
Referenced by MakeFreeSpace().
void XrdClientReadCache::RemoveItems | ( | bool | leavepinned = true | ) |
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::RemoveAllDataFromCache(), XrdClientConn::RemoveDataFromCache(), SubmitRawData(), and ~XrdClientReadCache().
void XrdClientReadCache::RemoveItems | ( | long long | begin_offs, |
long long | end_offs, | ||
bool | remove_overlapped = false |
||
) |
bool XrdClientReadCache::RemoveLRUItem | ( | ) | [private] |
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), and XrdClientReadCacheItem::Size().
Referenced by RemoveItem().
void XrdClientReadCache::RemovePlaceholders | ( | ) |
References XrdClientVector< T >::Erase(), fItems, fMutex, and XrdClientVector< T >::GetSize().
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 fBytesSubmitted, FindInsertionApprox(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), GetTimestampTick(), Info, XrdClientVector< T >::Insert(), XrdClientDebug::kHIDEBUG, MakeFreeSpace(), XrdClientReadCacheItem::Pinned, RemoveItems(), and XrdClientReadCacheItem::Size().
Referenced by XrdClientConn::SubmitRawDataToCache(), SubmitXMessage(), and XrdClientConn::WriteToServer_Async().
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 FindInsertionApprox(), fItems, fMutex, fTotalByteCount, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::UnPinCacheBlk().
void XrdClientReadCache::UpdatePerfCounters | ( | ) | [inline, private] |
References fBytesHit, fBytesSubmitted, fBytesUsefulness, fMissCount, fMissRate, and fReadsCounter.
Referenced by GetDataIfPresent().
bool XrdClientReadCache::WillFit | ( | long long | bc | ) | [inline] |
References fMaxCacheSize, and fMutex.
Referenced by XrdClientConn::CacheWillFit(), and MakeFreeSpace().
int XrdClientReadCache::fBlkRemPolicy [private] |
Referenced by GetDataIfPresent(), RemoveItem(), SetBlkRemovalPolicy(), and XrdClientReadCache().
long long XrdClientReadCache::fBytesHit [private] |
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
long long XrdClientReadCache::fBytesSubmitted [private] |
Referenced by GetInfo(), PrintPerfCounters(), SubmitRawData(), UpdatePerfCounters(), and XrdClientReadCache().
float XrdClientReadCache::fBytesUsefulness [private] |
Referenced by GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
ItemVect XrdClientReadCache::fItems [private] |
long long XrdClientReadCache::fMaxCacheSize [private] |
Referenced by GetInfo(), MakeFreeSpace(), SetSize(), WillFit(), and XrdClientReadCache().
long long XrdClientReadCache::fMissCount [private] |
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
float XrdClientReadCache::fMissRate [private] |
Referenced by GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
XrdSysRecMutex XrdClientReadCache::fMutex [private] |
long long XrdClientReadCache::fReadsCounter [private] |
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
long long XrdClientReadCache::fTimestampTickCounter [private] |
Referenced by GetTimestampTick(), and XrdClientReadCache().
long long XrdClientReadCache::fTotalByteCount [private] |