Data Structures¶
-
class
CacheHostTable
¶ A container that maps from a FQDN to a
CacheHostRecord
. This is constructed from the contents ofhosting.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.
-
void
-
class
CacheHostResult
¶ A wrapper for
CacheHostRecord
used byCacheHostTable::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
.-
Vol **
vols
¶ The stripes that are part of the cache volumes. This is the union over the stripes of
CacheHostRecord::cp
-
unsigned short *
vol_hash_table
¶ The stripe assignment table. This is an array of indices in to
CacheHostRecord::vols
.
-
Vol **
-
class
OpenDir
¶ An open directory entry. It contains all the information of a
Dir
plus additional information from the firstDoc
.
-
class
CacheVC
¶ A virtual connection class which accepts input for writing to cache.
-
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 repository 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 (possiblyNULL
) to an instance of the wrapped class.
-
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
Doc
of 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.
-
int
aggWrite
(int event, void *e)¶ Schedule the aggregation buffer to be written to disk.
-
off_t
segments
¶ The 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
buckets
¶ The 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>
evacuate
¶ Array of
EvacuationBlock
buckets. This is sized so there is one bucket for every evacuation span.
-
int
evac_range
(off_t low, off_t high, int evac_phase)¶ Start an evacuation if there is any
EvacuationBlock
in the range from low to high. Return0
if no evacuation was started, non-zero otherwise.
-
int
-
class
Doc
¶ Defined in iocore/cache/P_CacheVol.h.
-
uint32_t
len
¶ The length of this segment including the header length, fragment table, and this structure.
-
uint64_t
total_len
¶ Total length of the entire document not including meta data but including headers.
-
INK_MD5
first_key
¶ First index key in the document (the index key used to locate this object in the volume index).
-
INK_MD5
key
¶ The 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.
-
uint8_t
ftype
¶ Fragment type. Currently only
CACHE_FRAG_TYPE_HTTP
is used. Other types may be used for cache extensions if those are ever implemented.
-
uint24_t
flen
¶ Fragment table length, if any. Only the first
Doc
in 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
Doc
the 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
-
class
DiskHeader
¶ Header for a span. This is a serialized data structure.
-
unsigned int
magic
¶ Holds a magic value :code:
DISK_HEADER_MAGIC
to indicate the span is valid and initialized.
-
unsigned int
num_volumes
¶ Number of cache volumes containing stripes in this span.
-
unsigned int
num_free
¶ The number of span blocks defined but not in use.
-
unsigned int
num_used
¶ The number of span blocks in use by stripes.
-
unsigned int
num_diskvol_blks
¶ The number of span blocks.
-
DiskVolBlock
vol_info
[1]¶ A flexible array. The actual length of this array is
num_diskvol_blks
and each element describes a span block.
-
unsigned int
-
class
DiskVolBlock
¶ A description of a span stripe (Vol) block . This is a serialized data structure.
-
int
number
¶ The cache volume index for this span block.
-
unsigned int __attribute__((bitfield_3))
type
¶ Type of the span block.
-
unsigned int __attribute__((bitfield_1))
free
¶ In use or free flag - set if the span block is not in use by a cache volume.
-
int
Container for a magic value,
VOL_MAGIC
, to indicate the instance is valid.
Version of the instance.
Epoch time when the stripe was created.
Position of the write cursor, as a byte offset in the stripe.
Location of the write cursor of the most recently completed disk write.
The byte offset in the stripe where the current aggregation buffer will be written.
Generation of this instance.
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
¶ -
-
int
new_block
¶ Indicates 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
¶
-
int
-
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_volblocks
¶ Number of blocks in the stripe identified by vol_number
-
Queue<DiskVolBlockQueue>
dpb_queue
¶
-
int
-
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_number
¶ identification number of this volume
-
int
scheme
¶ An enumeration of value
CacheType::HTTP
orCacheType::Stream
.
-
Vol **
vols
¶ Vol
represents a single stripe in the disk. vols contains all the stripes this volume is made up of
-
RecRawStatBlock
vol_rsb
¶ per volume stat
-
int
-
class
ConfigVol
¶ This class represents an individual volume.
-
int
number
¶ Identification number of the volume
-
bool
in_percent
¶ Used as an indicator if the volume is part of the overall volumes created by ATS
-
int
percent
¶
-
int
-
class
ConfigVolumes
¶ -
int
num_volumes
¶ Total number of volumes specified in volume.config
-
int
num_http_volumes
¶ Total number of volumes specified in volume.config for HTTP scheme
-
int
-
class
Cache
¶ Base object for a cache.
-
CacheHostRecord
hosttable
¶ A 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 appropriateCacheHostRecord
instance. 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.
-
CacheHostRecord
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.