Data Structures

size_t STORE_BLOCK_SIZE = 8192
The storage unit for span and stripe metadata.
class CacheHostTable
A container that maps from a FQDN to a CacheHostRecord. This is constructed from the contents of hosting.config.
void
Match(char const *fqdn, int len, CacheHostResult *result)Search the table for a match for the hostname fqdn, a string of length len. If found the result is placed in result.
class CacheHostResult
A wrapper for CacheHostRecord used by CacheHostTable::Match(). This contains the set of cache volumes for the cache host record and is used to perform stripe assignment.
class CacheHostRecord
A cache hosting record from hosting.config.
CacheVol **
cpThe cache volumes that are part of this cache host record.
Vol **
volsThe stripes that are part of the cache volumes. This is the union over the stripes of
CacheHostRecord::cpunsigned short *
vol_hash_tableThe stripe assignment table. This is an array of indices in to
CacheHostRecord::vols.
class OpenDir
An open directory entry. It contains all the information of a Dir plus additional information from the first Doc.
class CacheVC
A virtual connection class which accepts input for writing to cache.
int
openReadStartHead(int event, Event *e)Performs the initial read for a cached object.
int
openReadStartEarliest(int event, Event *e)Performs the initial read for an alternate of an object.
class HttpTunnel
Data transfer driver. This contains a set of producers. Each producer is connected to one or more consumers. The tunnel handles events and buffers so that data moves from producers to consumers. The data, as much as possible, is kept in reference counted buffers so that copies are done only when the data is modified or for sources (which acquire data from outside Traffic Server) and sinks (which move data to outside Traffic Server).
class CacheControlResult
Holds the data from a line in cache.config.
class CacheHTTPInfoVector
Defined in iocore/cache/P_CacheHttp.h. This is an array of HTTPInfo objects and serves as the respository of information about alternates of an object. It is marshaled as part of the metadata for an object in the cache.
class HTTPInfo
Defined in proxy/hdrs/HTTP.h.
This class is a wrapper for HTTPCacheAlt. It provides the external API for accessing data in the wrapped class. It contains only a pointer (possibly NULL) to an instance of the wrapped class.
class CacheHTTPInfo
A typedef for HTTPInfo.
class HTTPCacheAlt
Defined in proxy/hdrs/HTTP.h.
This is the metadata for a single alternate for a cached object. It contains, among other data, the following:
- The key for the earliest
Docof the alternate. - The request and response headers.
- The fragment offset table.[#fragment-offset-table]_
- Timestamps for request and response from origin server.
class Vol
This represents a storage unit inside a cache volume.
off_t
data_blocksThe number of blocks of storage in the stripe.
int
aggWrite(int event, void *e)Schedule the aggregation buffer to be written to disk.
off_t
segmentsThe number of segments in the volume. This will be roughly the total number of entries divided by the number of entries in a segment. It will be rounded up to cover all entries.
off_t
bucketsThe number of buckets in the volume. This will be roughly the number of entries in a segment divided by
DIR_DEPTH. For currently defined values this is around 16,384 (2^16 / 4). Buckets are used as the targets of the index hash.DLL<EvacuationBlock>
evacuateArray of of
EvacuationBlockbuckets. This is sized so there is one bucket for every evacuation span.off_t
lenLength of stripe in bytes.
int
evac_range(off_t low, off_t high, int evac_phase)Start an evacuation if there is any
EvacuationBlockin the range from low to high. Return0if no evacuation was started, non-zero otherwise.
class Doc
Defined in iocore/cache/P_CacheVol.h.
uint32_t
magicValidity check value. Set to
DOC_MAGICfor a valid document.uint32_t
lenThe length of this segment including the header length, fragment table, and this structure.
uint64_t
total_lenTotal length of the entire document not including meta data but including headers.
INK_MD5
first_keyFirst index key in the document (the index key used to locate this object in the volume index).
INK_MD5
keyThe index key for this fragment. Fragment keys are computationally chained so that the key for the next and previous fragments can be computed from this key.
uint32_t
hlenDocument header (metadata) length. This is not the length of the HTTP headers.
uint8_t
ftypeFragment type. Currently only
CACHE_FRAG_TYPE_HTTPis used. Other types may be used for cache extensions if those are ever implemented.uint24_t
flenFragment table length, if any. Only the first
Docin an object should contain a fragment table.The fragment table is a list of offsets relative to the HTTP content (not counting metadata or HTTP headers). Each offset is the byte offset of the first byte in the fragment. The first element in the table is the second fragment (what would be index 1 for an array). The offset for the first fragment is of course always zero and so not stored. The purpose of this is to enable a fast seek for range requests. Given the first
Docthe fragment containing the first byte in the range can be computed and loaded directly without further disk access.Removed as of version 3.3.0. [1]
uint32_t
sync_serialUnknown.
uint32_t
write_serialUnknown.
uint32_t
pinnedFlag and timer for pinned objects.
uint32_t
checksumUnknown.
class DiskHeader
Header for a span. This is a serialized data structure.
unsigned int
magicHolds a magic value :code:
DISK_HEADER_MAGICto indicate the span is valid and initialized.unsigned int
num_volumesNumber of cache volumes containing stripes in this span.
unsigned int
num_freeThe number of span blocks defined but not in use.
unsigned int
num_usedThe number of span blocks in use by stripes.
unsigned int
num_diskvol_blksThe number of span blocks.
uint64_t
num_blocksThe number of volume blocks in the span.
DiskVolBlock
vol_info[1]A flexible array. The actual length of this array is
num_diskvol_blksand each element describes a span block.
class DiskVolBlock
A description of a span stripe (Vol) block . This is a serialized data structure.
uint64_t
offsetOffset in the span of the start of the span stripe (Vol) block, in bytes.
uint64_t
lenLength of the span block in store blocks.
int
numberThe cache volume index for this span block.
unsigned int __attribute__((bitfield_3))
typeType of the span block.
unsigned int __attribute__((bitfield_1))
freeIn use or free flag - set if the span block is not in use by a cache volume.
class VolHeaderFooter
unsigned int
magicContainer for a magic value,
VOL_MAGIC, to indicate the instance is valid.VersionNumber
versionVersion of the instance.
time_t
create_timeEpoch time when the stripe was created.
off_t
write_posPosition of the write cursor, as a byte offset in the stripe.
off_t
last_write_posLocation of the write cursor of the most recently completed disk write.
off_t
agg_posThe byte offset in the stripe where the current aggregation buffer will be written.
uint32_t
generationGeneration of this instance.
uint32_t
phaseuint32_t
cycleuint32_t
sync_serialuint32_t
write_serialuint32_t
dirtyuint32_t
unuseduint16_t
freelist[1]An array of directory entry indices. Each element is the directory entry of the start of the free list for a segment, in the same order as the segments in the directory.
class DiskVolBlockQueue
DiskVolBlock *
bint
new_blockIndicates if this is a new stripe rather than an existing one. In case a stripe is new ATS decides to clear that stripe(
Vol)LINK<DiskVolBlockQueue>
link
class DiskVol
Describes the Disk that contains the stripe identified by vol_number. This class also contains the queue containing all the DiskVolBlock
int
num_volblocksNumber of blocks in the stripe identified by vol_number
int
vol_numberIdentification number of the stripe (
Vol)uint64_t
sizeSize of the stripe
CacheDisk *
diskThe disk containing the stripe
Queue<DiskVolBlockQueue>
dpb_queue
enum CacheType
enumerator
HTTPenumerator
Stream
class CacheVol
A cache volume as described in volume.config. This class represents a single volume. CacheVol comprises of stripes spread across Spans(disks)
int
volume_numberindentification number of this volume
int
schemeAn enumeration of value
CacheType::HTTPorCacheType::Stream.off_t
sizeint
num_volsNumber of stripes(
Vol) contained in this volumeVol **
volsVolrepresents a single stripe in the disk. vols contains all the stripes this volume is made up ofDiskVol **
disk_volsdisk_vols contain references to the disks of all the stripes in this volume
RecRawStatBlock
vol_rsbper volume stat
class ConfigVol
This class represents an individual volume.
int
numberIdentification number of the volume
CacheType
schemeoff_t
sizebool
in_percentUsed as an indicator if the volume is part of the overall volumes created by ATS
int
percentCacheVol *
cachep
class ConfigVolumes
int
num_volumesTotal number of volumes specified in volume.config
int
num_http_volumesTotal number of volumes scpecified in volume.config for HTTP scheme
class Cache
Base object for a cache.
CacheHostRecord
hosttableA generic class:CacheHostRecord that contains all cache volumes that are not explicitly assigned in
hosting.config.Vol *
key_to_vol(const char *key, const char *host, int host_len)Compute the stripe (
Vol*) for a cache key and host. The host is used to find the appropriateCacheHostRecordinstance. From there the stripe assignment slot is determined by taking bits 64..83 (20 bits) of the cache key modulo the stripe assignment array count (VOL_HASH_TABLE_SIZE). These bits are the third 32 bit slice of the key less the bottomDIR_TAG_WIDTH(12) bits.
Footnotes
| [1] | Changed in version 3.2.0. This previously resided in the first Doc but that caused different alternates to share the same fragment table. |
