store.cc File Reference
#include "squid.h"
#include "base/AsyncCbdataCalls.h"
#include "base/PackableStream.h"
#include "base/TextException.h"
#include "CacheDigest.h"
#include "CacheManager.h"
#include "CollapsedForwarding.h"
#include "comm/Connection.h"
#include "comm/Read.h"
#include "debug/Messages.h"
#include "ETag.h"
#include "event.h"
#include "fde.h"
#include "globals.h"
#include "http.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "mem_node.h"
#include "MemObject.h"
#include "MemStore.h"
#include "mgr/Registration.h"
#include "mgr/StoreIoAction.h"
#include "repl_modules.h"
#include "RequestFlags.h"
#include "sbuf/Stream.h"
#include "SquidConfig.h"
#include "StatCounters.h"
#include "stmem.h"
#include "Store.h"
#include "store/Controller.h"
#include "store/Disk.h"
#include "store/Disks.h"
#include "store/SwapMetaOut.h"
#include "store_digest.h"
#include "store_key_md5.h"
#include "store_log.h"
#include "store_rebuild.h"
#include "StoreClient.h"
#include "StoreIOState.h"
#include "StrList.h"
#include "swap_log_op.h"
#include "tools.h"
#include "DelayPools.h"
#include "mem/Allocator.h"
#include "mem/Pool.h"
#include <climits>
#include <stack>
Include dependency graph for store.cc:

Go to the source code of this file.

Classes

struct  _storerepl_entry
 
struct  _store_check_cachable_hist
 

Macros

#define REBUILD_TIMESTAMP_DELTA_MAX   2
 
#define STORE_IN_MEM_BUCKETS   (229)
 
#define MAINTAIN_MAX_SCAN   1024
 
#define MAINTAIN_MAX_REMOVE   64
 

Typedefs

typedef struct _storerepl_entry storerepl_entry_t
 

Functions

static int getKeyCounter (void)
 
static void StatQueues (StoreEntry *e)
 reports the current state of Store-related queues More...
 
void destroyStoreEntry (void *data)
 
StoreEntrystoreGetPublic (const char *uri, const HttpRequestMethod &method)
 
StoreEntrystoreGetPublicByRequestMethod (HttpRequest *req, const HttpRequestMethod &method, const KeyScope keyScope)
 
StoreEntrystoreGetPublicByRequest (HttpRequest *req, const KeyScope keyScope)
 
StoreEntrystoreCreatePureEntry (const char *url, const char *log_url, const HttpRequestMethod &method)
 
StoreEntrystoreCreateEntry (const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
 
void storeAppendPrintf (StoreEntry *e, const char *fmt,...)
 
void storeAppendVPrintf (StoreEntry *e, const char *fmt, va_list vargs)
 
int storeTooManyDiskFilesOpen (void)
 
void storeCheckCachableStats (StoreEntry *sentry)
 
void storeGetMemSpace (int size)
 
static void storeLateRelease (void *)
 
static void storeRegisterWithCacheManager (void)
 
void storeInit (void)
 
void storeConfigure (void)
 
int expiresMoreThan (time_t expires, time_t when)
 
void storeFsInit (void)
 
void storeReplAdd (const char *type, REMOVALPOLICYCREATE *create)
 
RemovalPolicycreateRemovalPolicy (RemovalPolicySettings *settings)
 
static std::ostream & operator<< (std::ostream &os, const Store::IoStatus &io)
 
std::ostream & operator<< (std::ostream &os, const StoreEntry &e)
 

Variables

const char * memStatusStr []
 
const char * pingStatusStr []
 
const char * storeStatusStr []
 
const char * swapStatusStr []
 
static storerepl_entry_tstorerepl_list = nullptr
 
static OBJH storeCheckCachableStats
 
static EVH storeLateRelease
 
static std::stack< StoreEntry * > LateReleaseStack
 
struct _store_check_cachable_hist store_check_cachable_hist
 

Macro Definition Documentation

◆ MAINTAIN_MAX_REMOVE

#define MAINTAIN_MAX_REMOVE   64

Definition at line 1129 of file store.cc.

◆ MAINTAIN_MAX_SCAN

#define MAINTAIN_MAX_SCAN   1024

Definition at line 1128 of file store.cc.

◆ REBUILD_TIMESTAMP_DELTA_MAX

#define REBUILD_TIMESTAMP_DELTA_MAX   2

StoreEntry uses explicit new/delete operators, which set pool chunk size to 2MB XXX: convert to MEMPROXY_CLASS() API

Definition at line 69 of file store.cc.

◆ STORE_IN_MEM_BUCKETS

#define STORE_IN_MEM_BUCKETS   (229)

Definition at line 71 of file store.cc.

Typedef Documentation

◆ storerepl_entry_t

Definition at line 102 of file store.cc.

Function Documentation

◆ createRemovalPolicy()

◆ destroyStoreEntry()

void destroyStoreEntry ( void *  data)

◆ expiresMoreThan()

int expiresMoreThan ( time_t  expires,
time_t  when 
)

Definition at line 1324 of file store.cc.

References squid_curtime.

◆ getKeyCounter()

static int getKeyCounter ( void  )
static

Definition at line 514 of file store.cc.

Referenced by StoreEntry::setPrivateKey().

◆ operator<<() [1/2]

static std::ostream & operator<< ( std::ostream &  os,
const Store::IoStatus io 
)
static

Definition at line 2011 of file store.cc.

References Store::ioDone, Store::ioReading, Store::ioUndecided, and Store::ioWriting.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  os,
const StoreEntry e 
)

Definition at line 2031 of file store.cc.

References debugs.

◆ StatQueues()

static void StatQueues ( StoreEntry e)
static

Definition at line 133 of file store.cc.

References assert, CollapsedForwarding::StatQueue(), and IpcIoFile::StatQueue().

Referenced by storeRegisterWithCacheManager().

◆ storeAppendPrintf()

void storeAppendPrintf ( StoreEntry e,
const char *  fmt,
  ... 
)

Definition at line 841 of file store.cc.

References StoreEntry::vappendf().

Referenced by DiskThreadsIOStrategy::aioStats(), asnStats(), cacheDigestGuessStatsReport(), cacheDigestReport(), carpCachemgr(), clientdbDump(), commIncomingStats(), Auth::User::CredentialsCacheStats(), Store::Disks::Dump(), Fs::Ufs::UFSSwapDir::dump(), Ipc::ReadWriteLockStats::dump(), DelaySpec::dump(), Auth::SchemeConfig::dump(), DelayPool::dump(), MessageDelayPool::dump(), DiskdAction::dump(), Mgr::MenuAction::dump(), Mgr::ReconfigureAction::dump(), Mgr::RotateAction::dump(), Mgr::OfflineToggleAction::dump(), Mgr::FunAction::dump(), Mgr::InfoAction::dump(), Mgr::StoreIoAction::dump(), Format::Format::dump(), Note::dump(), ClientDelayPool::dump(), dump_access_log(), dump_acl(), dump_acl_address(), dump_acl_b_size_t(), dump_acl_tos(), dump_address(), dump_b_int64_t(), dump_b_size_t(), dump_b_ssize_t(), dump_cachemgrpasswd(), dump_CpuAffinityMap(), dump_denyinfo(), dump_externalAclHelper(), dump_generic_port(), dump_HeaderWithAclList(), dump_icap_service_failure_limit(), dump_int(), dump_int64_t(), dump_IpAddress_list(), dump_kb_int64_t(), dump_memcachemode(), dump_onoff(), dump_peer(), dump_peers(), dump_PortCfg(), dump_refreshpattern(), dump_removalpolicy(), dump_sslproxy_cert_adapt(), dump_sslproxy_cert_sign(), dump_string(), dump_time_nanoseconds(), dump_tristate(), dump_u_short(), dump_uri_whitespace(), dump_UrlHelperTimeout(), dump_wccp2_amethod(), dump_wccp2_method(), dump_wccp2_service(), dump_wccp2_service_info(), dump_wordlist(), DumpAvgStat(), DumpCountersStats(), PconnPool::dumpHash(), PconnPool::dumpHist(), DumpInfo(), DumpIoStats(), DumpMallocStatistics(), ClientDelayConfig::dumpPoolCount(), DelayConfig::dumpPoolCount(), Rock::SwapDir::dumpRateOption(), Adaptation::Config::dumpService(), Adaptation::Config::DumpServiceGroups(), DumpServiceTimesStats(), Rock::SwapDir::dumpSizeOption(), fde::dumpStats(), fde::DumpStats(), Rock::SwapDir::dumpTimeOption(), externalAclStats(), fqdnStats(), fwdStats(), header_mangler_dump_access(), header_mangler_dump_replacement(), httpHdrCcStatDumper(), httpHdrScStatDumper(), httpHdrScTargetStatDumper(), httpHeaderFieldStatDumper(), httpHeaderFldsPerHdrDumper(), httpHeaderStatDump(), httpHeaderStoreReport(), idnsStats(), ipcacheStatPrint(), lru_stats(), netdbBinaryExchange(), netdbDump(), Fs::Ufs::UFSSwapDir::optionIODump(), Store::Disk::optionObjectSizeDump(), DiskdIOStrategy::optionQ1Dump(), DiskdIOStrategy::optionQ2Dump(), Store::Disk::optionReadOnlyDump(), peerDigestStatsReport(), peerSourceHashCachemgr(), peerUserHashCachemgr(), printRadixNode(), redirectStats(), refreshCountsStats(), refreshCountsStatsEntry(), refreshStats(), squidaio_stats(), Store::Controller::stat(), Store::Disk::stat(), Store::Disks::stat(), MemStore::stat(), Transients::stat(), stat_ipcache_get(), statClientRequests(), statCountersHistograms(), statDigestBlob(), Fs::Ufs::UFSSwapDir::statfs(), Rock::SwapDir::statfs(), DiskdIOStrategy::statfs(), statHistBinDumper(), statHistEnumDumper(), statHistIntDumper(), statHistSBufDumper(), statObjects(), statPeerSelect(), DelayPools::Stats(), ClassCBucket::stats(), DelayBucket::stats(), DelayTaggedBucket::stats(), DelayUserBucket::stats(), Aggregate::stats(), VectorPool::stats(), ClassCHostPool::stats(), DelayTagged::stats(), DelayUser::stats(), DelaySpec::stats(), statUtilization(), storeCheckCachableStats(), storeDigestReport(), storeIdStats(), and storeLogTagsHist().

◆ storeAppendVPrintf()

void storeAppendVPrintf ( StoreEntry e,
const char *  fmt,
va_list  vargs 
)

Definition at line 851 of file store.cc.

References StoreEntry::vappendf().

◆ storeCheckCachableStats()

◆ storeConfigure()

void storeConfigure ( void  )

Definition at line 1256 of file store.cc.

References Store::Controller::configure(), and Store::Root().

Referenced by configDoConfigure(), and storeSwapOutFileClosed().

◆ storeCreateEntry()

◆ storeCreatePureEntry()

StoreEntry * storeCreatePureEntry ( const char *  storeId,
const char *  logUrl,
const HttpRequestMethod method 
)

◆ storeFsInit()

void storeFsInit ( void  )

Definition at line 1622 of file store.cc.

References storeReplSetup().

Referenced by SquidMain().

◆ storeGetMemSpace()

void storeGetMemSpace ( int  size)

Clear Memory storage to accommodate the given object len

Definition at line 1107 of file store.cc.

References Store::Controller::freeMemorySpace(), Store::Root(), and size.

Referenced by store_client::maybeWriteFromDiskToMemory(), and StoreEntry::write().

◆ storeGetPublic()

◆ storeGetPublicByRequest()

◆ storeGetPublicByRequestMethod()

StoreEntry * storeGetPublicByRequestMethod ( HttpRequest req,
const HttpRequestMethod method,
const KeyScope  keyScope 
)

◆ storeInit()

◆ storeLateRelease()

static void storeLateRelease ( void *  )
static

◆ storeRegisterWithCacheManager()

static void storeRegisterWithCacheManager ( void  )
static

◆ storeReplAdd()

void storeReplAdd ( const char *  type,
REMOVALPOLICYCREATE create 
)

◆ storeTooManyDiskFilesOpen()

int storeTooManyDiskFilesOpen ( void  )

Variable Documentation

◆ LateReleaseStack

std::stack<StoreEntry*> LateReleaseStack
static

Definition at line 121 of file store.cc.

Referenced by StoreEntry::release(), and storeLateRelease().

◆ memStatusStr

const char* memStatusStr[]
Initial value:
= {
"NOT_IN_MEMORY",
"IN_MEMORY"
}

Definition at line 75 of file store.cc.

◆ pingStatusStr

const char* pingStatusStr[]
Initial value:
= {
"PING_NONE",
"PING_WAITING",
"PING_DONE"
}

Definition at line 80 of file store.cc.

◆ store_check_cachable_hist

struct _store_check_cachable_hist store_check_cachable_hist

◆ storeCheckCachableStats

OBJH storeCheckCachableStats
static

Definition at line 115 of file store.cc.

Referenced by storeRegisterWithCacheManager().

◆ storeLateRelease

EVH storeLateRelease
static

Definition at line 116 of file store.cc.

Referenced by storeInit(), and storeLateRelease().

◆ storerepl_list

storerepl_entry_t* storerepl_list = nullptr
static

Definition at line 109 of file store.cc.

Referenced by createRemovalPolicy(), and storeReplAdd().

◆ storeStatusStr

const char* storeStatusStr[]
Initial value:
= {
"STORE_OK",
"STORE_PENDING"
}

Definition at line 86 of file store.cc.

◆ swapStatusStr

const char* swapStatusStr[]
Initial value:
= {
"SWAPOUT_NONE",
"SWAPOUT_WRITING",
"SWAPOUT_DONE",
"SWAPOUT_FAILED"
}

Definition at line 91 of file store.cc.

Referenced by StoreEntry::attachToDisk().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors