95 uint64_t cap = e_count ? e_count : hi_cap;
96 debugs(71, 2,
"have: " << e_count <<
", want " << cap <<
97 " entries; limits: [" << lo_cap <<
", " << hi_cap <<
"]");
110 if (cap > absolute_max) {
111 static time_t last_loud = 0;
113 debugs(71,
DBG_IMPORTANT,
"WARNING: Cache Digest cannot store " << cap <<
" entries. Limiting to " << absolute_max);
116 debugs(71, 3,
"WARNING: Cache Digest cannot store " << cap <<
" entries. Limiting to " << absolute_max);
133 debugs(71, 3,
"Local cache digest generation disabled");
146 debugs(71, 3,
"Local cache digest is 'off'");
175 debugs(71, 6,
"storeDigestDel: checking entry, key: " << entry->
getMD5Text());
180 debugs(71, 6,
"storeDigestDel: lost entry, key: " << entry->
getMD5Text() <<
" url: " << entry->
url() );
202 static const SBuf label(
"store");
232 debugs(71, 6,
"storeDigestAddable: checking entry, key: " << e->
getMD5Text());
237 debugs(71, 6,
"storeDigestAddable: NO: private key");
242 debugs(71, 6,
"storeDigestAddable: NO: negative cached");
247 debugs(71, 6,
"storeDigestAddable: NO: release requested");
252 debugs(71, 6,
"storeDigestAddable: NO: wrong content-length");
258 debugs(71, 6,
"storeDigestAddable: NO: too big");
315 debugs(71,
DBG_IMPORTANT,
"storeDigestRebuildStart: overlap detected, consider increasing rebuild period");
323 debugs(71, 2,
"storeDigestRebuildStart: waiting for Rewrite to finish.");
345 if (diff <= store_digest->capacity / 10) {
346 debugs(71, 2,
"small change, will not resize.");
349 debugs(71, 2,
"big change, resizing.");
379 debugs(71, 2,
"storeDigestRebuildFinish: done.");
417 debugs(71,
DBG_IMPORTANT,
"storeDigestRewrite: overlap detected, consider increasing rewrite period");
424 const auto mx = MasterXaction::MakePortless<XactionInitiator::initCacheDigest>();
433 debugs(71, 3,
"storeDigestRewrite: url: " << url <<
" key: " << e->
getMD5Text());
438 debugs(71, 2,
"storeDigestRewriteStart: waiting for rebuild to finish.");
458 oldEntry->release(
true);
460 oldEntry->
unlock(
"storeDigestRewriteResume");
469 debugs(71, 3,
"storeDigestRewrite: entry expires on " << rep->
expires <<
485 debugs(71, 2,
"storeDigestRewriteFinish: digest expires at " << e->
expires <<
516 chunk_size <<
" bytes");
void cacheDigestReport(CacheDigest *cd, const SBuf &label, StoreEntry *e)
void updateCapacity(uint64_t newCapacity)
changes mask size to fit newCapacity, resets bits to 0
void add(const cache_key *key)
bool contains(const cache_key *key) const
void clear()
reset the digest mask and counters
void remove(const cache_key *key)
void setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires)
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
HttpRequestPointer request
SupportOrVeto cachable
whether the response may be stored in the cache
struct SquidConfig::@96 digest
size_t swapout_chunk_size
struct SquidConfig::@90 onoff
int rebuild_chunk_percentage
struct SquidConfig::@88 Store
unsigned char bits_per_entry
unsigned char hash_func_count
StoreEntry * publicEntry
points to the previous store entry with the digest
int rebuild_lock
bucket number
StoreSearchPointer theSearch
StoreEntry * rewrite_lock
points to store entry with the digest
int unlock(const char *context)
const char * getMD5Text() const
static size_t inUseCount()
void replaceHttpReply(const HttpReplyPointer &, const bool andStartWriting=true)
void append(char const *, int) override
Appends a c-string to existing packed data.
bool setPublicKey(const KeyScope keyScope=ksDefault)
virtual void next(void(callback)(void *cbdata), void *cbdata)=0
virtual StoreEntry * currentItem()=0
virtual bool isDone() const =0
uint64_t maxSize() const override
uint64_t currentSize() const override
current size
#define debugs(SECTION, LEVEL, CONTENT)
#define EBIT_SET(flag, bit)
#define EBIT_TEST(flag, bit)
@ RELEASE_REQUEST
prohibits making the key public
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
int CacheDigestHashFuncCount
const char * StoreDigestFileName
CacheDigest * store_digest
char * internalLocalUri(const char *dir, const SBuf &name)
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
Controller & Root()
safely access controller singleton
Version const CacheDigestVer
int refreshCheckDigest(const StoreEntry *entry, time_t delta)
unsigned char cache_key
Store key.
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
static StoreDigestStats sd_stats
static void storeDigestRebuildStart(void *datanotused)
static EVH storeDigestSwapOutStep
static void storeDigestRebuildResume(void)
static void storeDigestCBlockSwapOut(StoreEntry *e)
void storeDigestDel(const StoreEntry *entry)
static void storeDigestAdd(const StoreEntry *)
static void storeDigestRewriteFinish(StoreEntry *e)
static void storeDigestRebuildStep(void *datanotused)
void storeDigestNoteStoreReady(void)
static void storeDigestRewriteStart(void *)
void storeDigestReport(StoreEntry *e)
void storeDigestInit(void)
static uint64_t storeDigestCalcCap()
calculates digest capacity
static void storeDigestRebuildFinish(void)
static int storeDigestAddable(const StoreEntry *e)
static void storeDigestRewriteResume(void)
static bool storeDigestResize()
static StoreDigestState sd_state
double xpercent(double part, double whole)
int xpercentInt(double part, double whole)