#include <XrdClientReadCache.hh>
Public Types | |
enum | |
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 |
Definition at line 142 of file XrdClientReadCache.hh.
anonymous enum |
Definition at line 178 of file XrdClientReadCache.hh.
XrdClientReadCache::XrdClientReadCache | ( | ) |
Definition at line 62 of file XrdClientReadCache.cc.
References EnvGetLong, fBlkRemPolicy, fBytesHit, fBytesSubmitted, fBytesUsefulness, fMaxCacheSize, fMissCount, fMissRate, fReadsCounter, fTimestampTickCounter, fTotalByteCount, NAME_READCACHEBLKREMPOLICY, and NAME_READCACHESIZE.
XrdClientReadCache::~XrdClientReadCache | ( | ) |
Definition at line 52 of file XrdClientReadCache.cc.
References fMutex, and fTimestampTickCounter.
Referenced by GetDataIfPresent(), PutPlaceholder(), and SubmitRawData().
Definition at line 864 of file XrdClientReadCache.cc.
References fMaxCacheSize, fMutex, fTotalByteCount, RemoveItem(), and WillFit().
Referenced by SubmitRawData().
bool XrdClientReadCache::RemoveItem | ( | ) | [private] |
Definition at line 847 of file XrdClientReadCache.cc.
References fBlkRemPolicy, kRmBlk_FIFO, kRmBlk_LeastOffs, kRmBlk_LRU, RemoveFirstItem(), and RemoveLRUItem().
Referenced by MakeFreeSpace().
bool XrdClientReadCache::RemoveLRUItem | ( | ) | [private] |
Definition at line 796 of file XrdClientReadCache.cc.
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), and XrdClientReadCacheItem::Size().
Referenced by RemoveItem().
bool XrdClientReadCache::RemoveFirstItem | ( | ) | [private] |
Definition at line 759 of file XrdClientReadCache.cc.
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), and XrdClientReadCacheItem::Size().
Referenced by RemoveItem().
void XrdClientReadCache::UpdatePerfCounters | ( | ) | [inline, private] |
Definition at line 165 of file XrdClientReadCache.hh.
References fBytesHit, fBytesSubmitted, fBytesUsefulness, fMissCount, fMissRate, and fReadsCounter.
Referenced by GetDataIfPresent().
Definition at line 174 of file XrdClientReadCache.cc.
References FindInsertionApprox_rec(), fItems, XrdClientVector< T >::GetSize(), and i.
Referenced by FindBlk(), GetDataIfPresent(), PutPlaceholder(), RemoveItems(), SubmitRawData(), and UnPinCacheBlk().
int XrdClientReadCache::FindInsertionApprox_rec | ( | int | startidx, | |
int | endidx, | |||
long long | begin_offs | |||
) | [private] |
Definition at line 195 of file XrdClientReadCache.cc.
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 | |||
) |
Definition at line 316 of file XrdClientReadCache.cc.
References XrdClientCacheInterval::beginoffs, XrdClientVector< T >::Clear(), XrdClientCacheInterval::endoffs, fBlkRemPolicy, fBytesHit, FindInsertionApprox(), fItems, fMissCount, fMutex, fReadsCounter, XrdClientVector< T >::GetSize(), GetTimestampTick(), kRmBlk_FIFO, l, 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 | |||
) |
Definition at line 881 of file XrdClientReadCache.cc.
References fBytesHit, fBytesSubmitted, fBytesUsefulness, fMaxCacheSize, fMissCount, fMissRate, and fReadsCounter.
Referenced by XrdClientConn::GetCacheInfo().
Definition at line 242 of file XrdClientReadCache.cc.
References FindInsertionApprox(), fItems, fMutex, XrdClientVector< T >::GetSize(), GetTimestampTick(), XrdClientVector< T >::Insert(), and p.
Referenced by RemoveItems(), and XrdClientConn::SubmitPlaceholderToCache().
void XrdClientReadCache::PrintPerfCounters | ( | ) | [inline] |
Definition at line 222 of file XrdClientReadCache.hh.
References fBytesHit, fBytesSubmitted, fBytesUsefulness, fMissCount, fMissRate, fMutex, fReadsCounter, and m.
Referenced by XrdClientConn::~XrdClientConn().
void XrdClientReadCache::PrintCache | ( | ) |
Definition at line 474 of file XrdClientReadCache.cc.
References fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), Info, and XrdClientDebug::kUSERDEBUG.
Referenced by XrdClientConn::Disconnect(), and XrdClientConn::PrintCache().
void XrdClientReadCache::SubmitXMessage | ( | XrdClientMessage * | xmsg, | |
long long | begin_offs, | |||
long long | end_offs | |||
) |
Definition at line 160 of file XrdClientReadCache.cc.
References buffer, XrdClientMessage::DonateData(), free(), and SubmitRawData().
Referenced by XrdClientConn::ClientServerCmd(), and XrdClientConn::SubmitDataToCache().
bool XrdClientReadCache::SubmitRawData | ( | const void * | buffer, | |
long long | begin_offs, | |||
long long | end_offs, | |||
bool | pinned = false | |||
) |
Definition at line 92 of file XrdClientReadCache.cc.
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::RemoveItems | ( | bool | leavepinned = true |
) |
Definition at line 702 of file XrdClientReadCache.cc.
References XrdClientVector< T >::Erase(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), and xmlio::Size.
Referenced by XrdClientConn::RemoveAllDataFromCache(), XrdClientConn::RemoveDataFromCache(), SubmitRawData(), and ~XrdClientReadCache().
void XrdClientReadCache::RemoveItems | ( | long long | begin_offs, | |
long long | end_offs, | |||
bool | remove_overlapped = false | |||
) |
Definition at line 577 of file XrdClientReadCache.cc.
References XrdClientVector< T >::Erase(), FindInsertionApprox(), fItems, fMutex, fTotalByteCount, XrdClientVector< T >::GetSize(), PutPlaceholder(), and xrdmax.
void XrdClientReadCache::RemovePlaceholders | ( | ) |
Definition at line 732 of file XrdClientReadCache.cc.
References XrdClientVector< T >::Erase(), fItems, fMutex, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::HandleServerError(), and XrdClientConn::RemovePlaceholdersFromCache().
void XrdClientReadCache::SetSize | ( | int | sz | ) | [inline] |
Definition at line 248 of file XrdClientReadCache.hh.
References fMaxCacheSize.
Referenced by XrdClientConn::SetCacheSize().
void XrdClientReadCache::SetBlkRemovalPolicy | ( | int | p | ) | [inline] |
Definition at line 252 of file XrdClientReadCache.hh.
References fBlkRemPolicy.
Referenced by XrdClientConn::SetCacheRmPolicy().
Definition at line 542 of file XrdClientReadCache.cc.
References FindInsertionApprox(), fItems, fMutex, fTotalByteCount, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::UnPinCacheBlk().
Definition at line 507 of file XrdClientReadCache.cc.
References FindInsertionApprox(), fItems, fMutex, and XrdClientVector< T >::GetSize().
Referenced by XrdClientConn::DoWriteSoftCheckPoint().
Definition at line 260 of file XrdClientReadCache.hh.
References fMaxCacheSize, fMutex, and m.
Referenced by XrdClientConn::CacheWillFit(), and MakeFreeSpace().
long long XrdClientReadCache::fBytesHit [private] |
Definition at line 145 of file XrdClientReadCache.hh.
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
long long XrdClientReadCache::fBytesSubmitted [private] |
Definition at line 146 of file XrdClientReadCache.hh.
Referenced by GetInfo(), PrintPerfCounters(), SubmitRawData(), UpdatePerfCounters(), and XrdClientReadCache().
float XrdClientReadCache::fBytesUsefulness [private] |
Definition at line 147 of file XrdClientReadCache.hh.
Referenced by GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
ItemVect XrdClientReadCache::fItems [private] |
Definition at line 148 of file XrdClientReadCache.hh.
Referenced by FindBlk(), FindInsertionApprox(), FindInsertionApprox_rec(), GetDataIfPresent(), PrintCache(), PutPlaceholder(), RemoveFirstItem(), RemoveItems(), RemoveLRUItem(), RemovePlaceholders(), SubmitRawData(), and UnPinCacheBlk().
long long XrdClientReadCache::fMaxCacheSize [private] |
Definition at line 149 of file XrdClientReadCache.hh.
Referenced by GetInfo(), MakeFreeSpace(), SetSize(), WillFit(), and XrdClientReadCache().
long long XrdClientReadCache::fMissCount [private] |
Definition at line 150 of file XrdClientReadCache.hh.
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
float XrdClientReadCache::fMissRate [private] |
Definition at line 151 of file XrdClientReadCache.hh.
Referenced by GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
XrdSysRecMutex XrdClientReadCache::fMutex [private] |
Definition at line 152 of file XrdClientReadCache.hh.
Referenced by FindBlk(), GetDataIfPresent(), GetTimestampTick(), GetTotalByteCount(), MakeFreeSpace(), PrintCache(), PrintPerfCounters(), PutPlaceholder(), RemoveFirstItem(), RemoveItems(), RemoveLRUItem(), RemovePlaceholders(), SubmitRawData(), UnPinCacheBlk(), and WillFit().
long long XrdClientReadCache::fReadsCounter [private] |
Definition at line 153 of file XrdClientReadCache.hh.
Referenced by GetDataIfPresent(), GetInfo(), PrintPerfCounters(), UpdatePerfCounters(), and XrdClientReadCache().
int XrdClientReadCache::fBlkRemPolicy [private] |
Definition at line 154 of file XrdClientReadCache.hh.
Referenced by GetDataIfPresent(), RemoveItem(), SetBlkRemovalPolicy(), and XrdClientReadCache().
Definition at line 155 of file XrdClientReadCache.hh.
Referenced by GetTimestampTick(), and XrdClientReadCache().
long long XrdClientReadCache::fTotalByteCount [private] |
Definition at line 156 of file XrdClientReadCache.hh.
Referenced by GetTotalByteCount(), MakeFreeSpace(), PrintCache(), RemoveFirstItem(), RemoveItems(), RemoveLRUItem(), SubmitRawData(), UnPinCacheBlk(), and XrdClientReadCache().