#include "squid.h"
#include "debug/Stream.h"
#include "event.h"
#include "globals.h"
#include "mgr/Registration.h"
#include "store_digest.h"
#include "CacheDigest.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "internal.h"
#include "MemObject.h"
#include "PeerDigest.h"
#include "refresh.h"
#include "SquidConfig.h"
#include "Store.h"
#include "StoreSearch.h"
#include "util.h"
#include <cmath>
Go to the source code of this file.
Classes | |
class | StoreDigestState |
class | StoreDigestStats |
Functions | |
static void | storeDigestRebuildStart (void *datanotused) |
static void | storeDigestRebuildResume (void) |
static void | storeDigestRebuildFinish (void) |
static void | storeDigestRebuildStep (void *datanotused) |
static void | storeDigestRewriteStart (void *) |
static void | storeDigestRewriteResume (void) |
static void | storeDigestRewriteFinish (StoreEntry *e) |
static void | storeDigestCBlockSwapOut (StoreEntry *e) |
static void | storeDigestAdd (const StoreEntry *) |
static uint64_t | storeDigestCalcCap () |
calculates digest capacity More... | |
void | storeDigestInit (void) |
void | storeDigestNoteStoreReady (void) |
void | storeDigestDel (const StoreEntry *entry) |
void | storeDigestReport (StoreEntry *e) |
static int | storeDigestAddable (const StoreEntry *e) |
static bool | storeDigestResize () |
static void | storeDigestSwapOutStep (void *data) |
Variables | |
static StoreDigestState | sd_state |
static StoreDigestStats | sd_stats |
static EVH | storeDigestSwapOutStep |
Function Documentation
◆ storeDigestAdd()
|
static |
Definition at line 282 of file store_digest.cc.
References CacheDigest::add(), StoreDigestStats::add_coll_count, StoreDigestStats::add_count, assert, CacheDigest::contains(), debugs, StoreEntry::getMD5Text(), hash_link::key, StoreDigestStats::rej_coll_count, StoreDigestStats::rej_count, sd_stats, store_digest, and storeDigestAddable().
Referenced by storeDigestRebuildStep().
◆ storeDigestAddable()
|
static |
Definition at line 228 of file store_digest.cc.
References Config, debugs, SquidConfig::digest, EBIT_TEST, ENTRY_BAD_LENGTH, ENTRY_NEGCACHED, StoreEntry::flags, StoreEntry::getMD5Text(), KEY_PRIVATE, SquidConfig::maxObjectSize, SquidConfig::rebuild_period, refreshCheckDigest(), RELEASE_REQUEST, SquidConfig::Store, and StoreEntry::swap_file_sz.
Referenced by storeDigestAdd().
◆ storeDigestCalcCap()
|
static |
Definition at line 85 of file store_digest.cc.
References SquidConfig::avgObjectSize, SquidConfig::bits_per_entry, Config, Store::Controller::currentSize(), DBG_IMPORTANT, debugs, SquidConfig::digest, INT_MAX, StoreEntry::inUseCount(), Store::Controller::maxSize(), Store::Root(), squid_curtime, and SquidConfig::Store.
Referenced by storeDigestInit(), and storeDigestResize().
◆ storeDigestCBlockSwapOut()
|
static |
Definition at line 524 of file store_digest.cc.
References StoreEntry::append(), StoreDigestCBlock::bits_per_entry, SquidConfig::bits_per_entry, CacheDigestHashFuncCount, CacheDigestVer, CacheDigest::capacity, StoreDigestCBlock::capacity, StoreDigestState::cblock, Config, CacheDigest::count, StoreDigestCBlock::count, Version::current, CacheDigest::del_count, StoreDigestCBlock::del_count, SquidConfig::digest, StoreDigestCBlock::hash_func_count, CacheDigest::mask_size, StoreDigestCBlock::mask_size, Version::required, sd_state, store_digest, and StoreDigestCBlock::ver.
Referenced by storeDigestRewriteResume().
◆ storeDigestDel()
void storeDigestDel | ( | const StoreEntry * | entry | ) |
Definition at line 166 of file store_digest.cc.
References assert, Config, CacheDigest::contains(), debugs, StoreDigestStats::del_count, StoreDigestStats::del_lost_count, SquidConfig::digest_generation, EBIT_TEST, StoreEntry::flags, StoreEntry::getMD5Text(), hash_link::key, KEY_PRIVATE, SquidConfig::onoff, CacheDigest::remove(), sd_stats, store_digest, and StoreEntry::url().
◆ storeDigestInit()
void storeDigestInit | ( | void | ) |
Definition at line 126 of file store_digest.cc.
References SquidConfig::bits_per_entry, Config, DBG_IMPORTANT, debugs, SquidConfig::digest, SquidConfig::digest_generation, SquidConfig::onoff, SquidConfig::rebuild_period, Mgr::RegisterAction(), SquidConfig::rewrite_period, sd_state, store_digest, storeDigestCalcCap(), and storeDigestReport().
Referenced by storeInit().
◆ storeDigestNoteStoreReady()
void storeDigestNoteStoreReady | ( | void | ) |
Definition at line 152 of file store_digest.cc.
References Config, SquidConfig::digest_generation, SquidConfig::onoff, storeDigestRebuildStart(), and storeDigestRewriteStart().
Referenced by storeCleanup().
◆ storeDigestRebuildFinish()
|
static |
Definition at line 370 of file store_digest.cc.
References assert, Config, debugs, SquidConfig::digest, eventAdd(), StoreDigestState::rebuild_count, StoreDigestState::rebuild_lock, SquidConfig::rebuild_period, StoreDigestState::rewrite_lock, sd_state, storeDigestRebuildStart(), and storeDigestRewriteResume().
Referenced by storeDigestRebuildStep().
◆ storeDigestRebuildResume()
|
static |
Definition at line 353 of file store_digest.cc.
References assert, CacheDigest::clear(), eventAdd(), StoreDigestState::rebuild_lock, StoreDigestState::rewrite_lock, Store::Root(), sd_state, sd_stats, Store::Controller::search(), store_digest, storeDigestRebuildStep(), storeDigestResize(), and StoreDigestState::theSearch.
Referenced by storeDigestRebuildStart(), and storeDigestRewriteFinish().
◆ storeDigestRebuildStart()
|
static |
Definition at line 305 of file store_digest.cc.
References assert, DBG_IMPORTANT, debugs, StoreDigestState::rebuild_count, StoreDigestState::rebuild_lock, StoreDigestState::rewrite_lock, sd_state, store_digest, and storeDigestRebuildResume().
Referenced by storeDigestNoteStoreReady(), and storeDigestRebuildFinish().
◆ storeDigestRebuildStep()
|
static |
Definition at line 386 of file store_digest.cc.
References assert, Config, StoreSearch::currentItem(), debugs, SquidConfig::digest, double, eventAdd(), int, StoreSearch::isDone(), StoreSearch::next(), SquidConfig::objectsPerBucket, SquidConfig::rebuild_chunk_percentage, StoreDigestState::rebuild_lock, sd_state, SquidConfig::Store, store_hash_buckets, storeDigestAdd(), storeDigestRebuildFinish(), storeDigestRebuildStep(), and StoreDigestState::theSearch.
Referenced by storeDigestRebuildResume(), and storeDigestRebuildStep().
◆ storeDigestReport()
void storeDigestReport | ( | StoreEntry * | e | ) |
Definition at line 193 of file store_digest.cc.
References StoreDigestStats::add_coll_count, StoreDigestStats::add_count, cacheDigestReport(), Config, StoreDigestStats::del_count, SquidConfig::digest_generation, SquidConfig::onoff, StoreDigestStats::rej_coll_count, StoreDigestStats::rej_count, sd_stats, store_digest, storeAppendPrintf(), and xpercent().
Referenced by statDigestBlob(), and storeDigestInit().
◆ storeDigestResize()
|
static |
- Returns
- true if we actually resized the digest
Definition at line 328 of file store_digest.cc.
References assert, CacheDigest::capacity, debugs, store_digest, storeDigestCalcCap(), CacheDigest::updateCapacity(), and xpercentInt().
Referenced by storeDigestRebuildResume().
◆ storeDigestRewriteFinish()
|
static |
Definition at line 476 of file store_digest.cc.
References assert, StoreEntry::complete(), Config, debugs, SquidConfig::digest, eventAdd(), StoreEntry::expires, StoreEntry::mem_obj, StoreDigestState::rebuild_lock, StoreDigestState::rewrite_count, StoreDigestState::rewrite_lock, SquidConfig::rewrite_period, sd_state, squid_curtime, storeDigestRebuildResume(), storeDigestRewriteStart(), StoreEntry::timestampsSet(), and MemObject::unlinkRequest().
Referenced by storeDigestSwapOutStep().
◆ storeDigestRewriteResume()
|
static |
Definition at line 442 of file store_digest.cc.
References assert, StoreEntry::buffer(), StoreDigestState::cblock, Config, debugs, SquidConfig::digest, EBIT_SET, ENTRY_SPECIAL, eventAdd(), HttpReply::expires, StoreEntry::flags, StoreEntry::flush(), StoreEntry::locked(), CacheDigest::mask_size, StoreDigestState::publicEntry, StoreDigestState::rebuild_lock, StoreEntry::replaceHttpReply(), StoreDigestState::rewrite_lock, StoreDigestState::rewrite_offset, SquidConfig::rewrite_period, Http::scOkay, sd_state, HttpReply::setHeaders(), StoreEntry::setPublicKey(), squid_curtime, store_digest, storeDigestCBlockSwapOut(), storeDigestSwapOutStep, and StoreEntry::unlock().
Referenced by storeDigestRebuildFinish(), and storeDigestRewriteStart().
◆ storeDigestRewriteStart()
|
static |
Definition at line 407 of file store_digest.cc.
References assert, RequestFlags::cachable, DBG_IMPORTANT, debugs, HttpRequest::FromUrlXXX(), StoreEntry::getMD5Text(), internalLocalUri(), StoreEntry::mem_obj, Http::METHOD_GET, StoreDigestState::rebuild_lock, MemObject::request, StoreDigestState::rewrite_count, StoreDigestState::rewrite_lock, sd_state, store_digest, storeCreateEntry(), StoreDigestFileName, storeDigestRewriteResume(), and SupportOrVeto::support().
Referenced by storeDigestNoteStoreReady(), and storeDigestRewriteFinish().
◆ storeDigestSwapOutStep()
|
static |
Definition at line 497 of file store_digest.cc.
References StoreEntry::append(), assert, Config, debugs, SquidConfig::digest, eventAdd(), CacheDigest::mask, CacheDigest::mask_size, StoreDigestState::rewrite_lock, StoreDigestState::rewrite_offset, sd_state, store_digest, storeDigestRewriteFinish(), storeDigestSwapOutStep, and SquidConfig::swapout_chunk_size.
Variable Documentation
◆ sd_state
|
static |
Definition at line 68 of file store_digest.cc.
Referenced by storeDigestCBlockSwapOut(), storeDigestInit(), storeDigestRebuildFinish(), storeDigestRebuildResume(), storeDigestRebuildStart(), storeDigestRebuildStep(), storeDigestRewriteFinish(), storeDigestRewriteResume(), storeDigestRewriteStart(), and storeDigestSwapOutStep().
◆ sd_stats
|
static |
Definition at line 69 of file store_digest.cc.
Referenced by storeDigestAdd(), storeDigestDel(), storeDigestRebuildResume(), and storeDigestReport().
◆ storeDigestSwapOutStep
|
static |
Definition at line 79 of file store_digest.cc.
Referenced by storeDigestRewriteResume(), and storeDigestSwapOutStep().