|
Squid Web Cache master
|
#include <CacheDigest.h>
Public Member Functions | |
| CacheDigest (uint64_t capacity, uint8_t bpe) | |
| ~CacheDigest () | |
| CacheDigest * | clone () const |
| produce a new identical copy of the digest object | |
| void | clear () |
| reset the digest mask and counters | |
| void | updateCapacity (uint64_t newCapacity) |
| changes mask size to fit newCapacity, resets bits to 0 | |
| void | add (const cache_key *key) |
| void | remove (const cache_key *key) |
| bool | contains (const cache_key *key) const |
| double | usedMaskPercent () const |
| percentage of mask bits which are used | |
Static Public Member Functions | |
| static uint32_t | CalcMaskSize (uint64_t cap, uint8_t bpe) |
Public Attributes | |
| uint64_t | count |
| uint64_t | del_count |
| uint64_t | capacity |
| char * | mask |
| uint32_t | mask_size |
| int8_t | bits_per_entry |
Private Member Functions | |
| MEMPROXY_CLASS (CacheDigest) | |
| void | init (uint64_t newCapacity) |
Definition at line 20 of file CacheDigest.h.
| CacheDigest::CacheDigest | ( | uint64_t | capacity, |
| uint8_t | bpe | ||
| ) |
Definition at line 50 of file CacheDigest.cc.
References assert, SQUID_MD5_DIGEST_LENGTH, and updateCapacity().
| CacheDigest::~CacheDigest | ( | ) |
Definition at line 62 of file CacheDigest.cc.
| void CacheDigest::add | ( | const cache_key * | key | ) |
Definition at line 107 of file CacheDigest.cc.
References assert, cacheDigestHashKey(), CBIT_SET, CBIT_TEST, StatCounters::cd, count, StatHist::count(), hashed_keys, mask, StatCounters::on_xition_count, and statCounter.
Referenced by cacheResetDigest(), cacheStore(), and storeDigestAdd().
|
static |
calculate the size of mask required to digest up to a specified capacity and bitsize.
Definition at line 271 of file CacheDigest.cc.
References assert, and INT_MAX.
Referenced by init(), and peerDigestSetCBlock().
| void CacheDigest::clear | ( | ) |
Definition at line 79 of file CacheDigest.cc.
References count, del_count, mask, and mask_size.
Referenced by storeDigestRebuildResume().
| CacheDigest * CacheDigest::clone | ( | ) | const |
Definition at line 68 of file CacheDigest.cc.
References assert, bits_per_entry, capacity, count, del_count, mask, and mask_size.
Referenced by main().
| bool CacheDigest::contains | ( | const cache_key * | key | ) | const |
Definition at line 93 of file CacheDigest.cc.
References assert, cacheDigestHashKey(), CBIT_TEST, hashed_keys, and mask.
Referenced by peerDigestLookup(), storeDigestAdd(), and storeDigestDel().
|
private |
Definition at line 38 of file CacheDigest.cc.
References assert, bits_per_entry, CalcMaskSize(), capacity, debugs, mask, mask_size, and xcalloc().
Referenced by updateCapacity().
|
private |
| void CacheDigest::remove | ( | const cache_key * | key | ) |
Definition at line 140 of file CacheDigest.cc.
References assert, and del_count.
Referenced by cachePurge(), and storeDigestDel().
| void CacheDigest::updateCapacity | ( | uint64_t | newCapacity | ) |
Definition at line 86 of file CacheDigest.cc.
References init(), mask, and safe_free.
Referenced by CacheDigest(), and storeDigestResize().
| double CacheDigest::usedMaskPercent | ( | ) | const |
Definition at line 183 of file CacheDigest.cc.
References CacheDigestStats::bit_count, CacheDigestStats::bit_on_count, cacheDigestStats(), and xpercent().
Referenced by peerDigestUseful().
| int8_t CacheDigest::bits_per_entry |
Definition at line 60 of file CacheDigest.h.
Referenced by cacheDigestReport(), clone(), and init().
| uint64_t CacheDigest::capacity |
Definition at line 57 of file CacheDigest.h.
Referenced by cacheDigestReport(), clone(), init(), storeDigestCBlockSwapOut(), and storeDigestResize().
| uint64_t CacheDigest::count |
Definition at line 55 of file CacheDigest.h.
Referenced by add(), cacheDigestReport(), cacheResetDigest(), clear(), clone(), peerDigestSetCBlock(), and storeDigestCBlockSwapOut().
| uint64_t CacheDigest::del_count |
Definition at line 56 of file CacheDigest.h.
Referenced by cacheDigestReport(), clear(), clone(), peerDigestSetCBlock(), remove(), and storeDigestCBlockSwapOut().
| char* CacheDigest::mask |
Definition at line 58 of file CacheDigest.h.
Referenced by ~CacheDigest(), add(), cacheDigestStats(), clear(), clone(), contains(), init(), storeDigestSwapOutStep(), and updateCapacity().
| uint32_t CacheDigest::mask_size |
Definition at line 59 of file CacheDigest.h.
Referenced by cacheDigestHashKey(), cacheDigestStats(), clear(), clone(), GetCountersStats(), init(), peerDigestSetCBlock(), storeDigestCBlockSwapOut(), storeDigestRewriteResume(), and storeDigestSwapOutStep().