#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::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::~CacheDigest ( )

Definition at line 62 of file CacheDigest.cc.

References mask, and xfree.

Member Function Documentation

◆ add()

◆ CalcMaskSize()

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 273 of file CacheDigest.cc.

References assert, and INT_MAX.

Referenced by init(), and peerDigestSetCBlock().

◆ clear()

void CacheDigest::clear ( )

Definition at line 79 of file CacheDigest.cc.

References count, del_count, mask, and mask_size.

Referenced by storeDigestRebuildResume().

◆ clone()

CacheDigest * CacheDigest::clone ( ) const

Definition at line 68 of file CacheDigest.cc.

References CacheDigest(), assert, bits_per_entry, capacity, count, del_count, mask, and mask_size.

Referenced by main().

◆ contains()

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().

◆ init()

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  )

◆ remove()

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().

◆ updateCapacity()

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().

◆ usedMaskPercent()

double CacheDigest::usedMaskPercent ( ) const

Definition at line 183 of file CacheDigest.cc.

References cacheDigestStats(), Ping::stats, and xpercent().

Referenced by peerDigestUseful().

Member Data Documentation

◆ bits_per_entry

int8_t CacheDigest::bits_per_entry

Definition at line 60 of file CacheDigest.h.

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

◆ capacity

uint64_t CacheDigest::capacity

◆ count

uint64_t CacheDigest::count

◆ del_count

uint64_t CacheDigest::del_count

◆ mask

◆ mask_size

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






Web Site Translations