#include <CacheDigest.h>

Collaboration diagram for CacheDigest:

Public Member Functions

 CacheDigest (uint64_t capacity, uint8_t bpe)
 ~CacheDigest ()
CacheDigestclone () const
 produce a new identical copy of the digest object More...
void clear ()
 reset the digest mask and counters More...
void updateCapacity (uint64_t newCapacity)
 changes mask size to fit newCapacity, resets bits to 0 More...
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 More...

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

void init (uint64_t newCapacity)

Detailed Description

Definition at line 20 of file CacheDigest.h.

Constructor & Destructor Documentation

CacheDigest::CacheDigest ( uint64_t  capacity,
uint8_t  bpe 

Definition at line 50 of file CacheDigest.cc.

References assert, SQUID_MD5_DIGEST_LENGTH, and updateCapacity().

Referenced by clone().

CacheDigest::~CacheDigest ( )

Definition at line 62 of file CacheDigest.cc.

References mask, and xfree.

Member Function Documentation

uint32_t CacheDigest::CalcMaskSize ( uint64_t  cap,
uint8_t  bpe 

calculate the size of mask required to digest up to a specified capacity and bitsize.

Definition at line 284 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, CacheDigest(), capacity, count, del_count, mask, and mask_size.

Referenced by main().

bool CacheDigest::contains ( const cache_key key) const
true if the key belongs to the digest

Definition at line 93 of file CacheDigest.cc.

References assert, cacheDigestHashKey(), CBIT_TEST, hashed_keys, and mask.

Referenced by peerDigestLookup(), storeDigestAdd(), and storeDigestDel().

void CacheDigest::init ( uint64_t  newCapacity)

Definition at line 38 of file CacheDigest.cc.

References assert, bits_per_entry, CalcMaskSize(), capacity, debugs, mask, mask_size, and xcalloc.

Referenced by updateCapacity().

CacheDigest::MEMPROXY_CLASS ( CacheDigest  )
void CacheDigest::remove ( const cache_key key)

Definition at line 151 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

Member Data Documentation

int8_t CacheDigest::bits_per_entry

Definition at line 60 of file CacheDigest.h.

Referenced by cacheDigestReport(), clone(), and init().

uint64_t CacheDigest::capacity
uint64_t CacheDigest::count
uint64_t CacheDigest::del_count

The documentation for this class was generated from the following files:






Web Site Translations