#include <StoreSwapLogData.h>

Collaboration diagram for StoreSwapLogData:

Public Types

typedef int64_t SwappedTime
 type to use for storing time-related members; must be signed More...
 

Public Member Functions

bool sane () const
 consistency self-check: whether the data appears to make sense More...
 
void finalize ()
 call this before storing the log entry More...
 

Public Attributes

uint8_t op = 0
 
SwapChecksum24 checksum
 
sfileno swap_filen = 0
 
SwappedTime timestamp = 0
 
SwappedTime lastref = 0
 
SwappedTime expires = 0
 
SwappedTime lastmod = 0
 
uint64_t swap_file_sz = 0
 
uint16_t refcount
 
uint16_t flags = 0
 
unsigned char key [SQUID_MD5_DIGEST_LENGTH] = {}
 

Private Member Functions

 MEMPROXY_CLASS (StoreSwapLogData)
 

Detailed Description

Defines the structure of a binary swap.state file entry for UFS stores. TODO: Move to fs/ufs
Note
StoreSwapLogData entries are written in native machine byte order They are not necessarily portable across architectures.

Definition at line 82 of file StoreSwapLogData.h.

Member Typedef Documentation

◆ SwappedTime

Definition at line 88 of file StoreSwapLogData.h.

Member Function Documentation

◆ finalize()

void StoreSwapLogData::finalize ( )

◆ MEMPROXY_CLASS()

StoreSwapLogData::MEMPROXY_CLASS ( StoreSwapLogData  )
private

◆ sane()

bool StoreSwapLogData::sane ( ) const

Member Data Documentation

◆ checksum

SwapChecksum24 StoreSwapLogData::checksum

Fingerprint to weed out bogus/corrupted swap.state entries.

Definition at line 105 of file StoreSwapLogData.h.

Referenced by finalize(), and sane().

◆ expires

SwappedTime StoreSwapLogData::expires = 0

The value of the response's Expires: header, if any. If the response does not have an Expires: header, this is set to -1. If the response has an invalid (unparsable) Expires: header, it is also set to -1. There are some cases where Squid sets expires to -2. This happens for the internal "netdb" object and for FTP URL responses.

Definition at line 139 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ flags

uint16_t StoreSwapLogData::flags = 0

A copy of the StoreEntry flags field. Used as a sanity check when rebuilding the cache at startup. Objects that have the KEY_PRIVATE flag set are not added back to the cache.

Definition at line 166 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), and UFSCleanLog::write().

◆ key

unsigned char StoreSwapLogData::key[SQUID_MD5_DIGEST_LENGTH] = {}

◆ lastmod

SwappedTime StoreSwapLogData::lastmod = 0

The value of the response's Last-modified: header, if any. This is set to -1 if there is no Last-modified: header, or if it is unparsable.

Definition at line 146 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ lastref

SwappedTime StoreSwapLogData::lastref = 0

The last time that a client requested this object.

Definition at line 128 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ op

uint8_t StoreSwapLogData::op = 0

Either SWAP_LOG_ADD when an object is added to the disk storage, or SWAP_LOG_DEL when an object is deleted.

Definition at line 100 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ refcount

uint16_t StoreSwapLogData::refcount

The number of times that this object has been accessed (referenced). Since its a 16-bit quantity, it is susceptible to overflow if a single object is accessed 65,536 times before being replaced.

Definition at line 159 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), and UFSCleanLog::write().

◆ swap_file_sz

uint64_t StoreSwapLogData::swap_file_sz = 0

This is the number of bytes that the object occupies on disk. It includes the Squid "swap file header".

Definition at line 152 of file StoreSwapLogData.h.

Referenced by finalize(), Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ swap_filen

sfileno StoreSwapLogData::swap_filen = 0

The 32-bit file number which maps to a pathname. Only the low 24-bits are relevant. The high 8-bits are used as an index to an array of storage directories, and are set at run time because the order of storage directories may change over time.

Definition at line 114 of file StoreSwapLogData.h.

Referenced by finalize(), Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().

◆ timestamp

SwappedTime StoreSwapLogData::timestamp = 0

A Unix time value that represents the time when the origin server generated this response. If the response has a valid Date: header, this timestamp corresponds to that time. Otherwise, it is set to the Squid process time when the response is read (as soon as the end of headers are found).

Definition at line 123 of file StoreSwapLogData.h.

Referenced by Fs::Ufs::UFSSwapDir::logEntry(), UFSSwapLogParser_v1_32bs::ReadRecord(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), sane(), and UFSCleanLog::write().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors