A brief file description. More...
#include "P_Cache.h"
#include "P_CacheTest.h"
#include "StatPages.h"
#include "I_Layout.h"
Go to the source code of this file.
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file Cache.cc.
#define DOCACHE_CLEAR_DYN_STAT | ( | x | ) |
do { \ RecSetRawStatSum(rsb, x, 0); \ RecSetRawStatCount(rsb, x, 0); \ } while (0);
Definition at line 50 of file Cache.cc.
Referenced by reg_int().
#define REG_INT | ( | _str, | ||
_stat | ||||
) | reg_int(_str, (int)_stat, rsb, prefix) |
Definition at line 3417 of file Cache.cc.
Referenced by register_cache_stats().
void build_vol_hash_table | ( | CacheHostRecord * | cp | ) |
Definition at line 2036 of file Cache.cc.
References ats_free(), ats_malloc(), CACHE_MEM_FREE_TIMEOUT, cmprtable(), Debug, Vol::disk, DISK_BAD, ats::CryptoHash::fold(), Vol::hash_id, rtable_pair::idx, ink_assert, Vol::len, map, new_Freer(), next_rand(), CacheHostRecord::num_vols, rtable_pair::rval, VOL_HASH_EMPTY, CacheHostRecord::vol_hash_table, VOL_HASH_TABLE_SIZE, and CacheHostRecord::vols.
Referenced by cache_disk_replacement_stability(), CacheHostRecord::Init(), and rebuild_host_table().
int64_t cache_bytes_used | ( | int | volume | ) |
Definition at line 217 of file Cache.cc.
References DISK_BAD, gnvol, Vol::header, Vol::len, Vol::start, vol_dirlen(), and VolHeaderFooter::write_pos.
Referenced by cache_stats_bytes_used_cb().
int cache_stats_bytes_used_cb | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 234 of file Cache.cc.
References cache_bytes_total_stat, cache_bytes_used(), CACHE_INITIALIZED, cache_percent_full_stat, CacheProcessor::initialized, RecGetGlobalRawStatSum(), RecRawStatSyncSum(), and RecSetGlobalRawStatSum().
Referenced by register_cache_stats().
static int cmprtable | ( | const void * | aa, | |
const void * | bb | |||
) | [static] |
Definition at line 2027 of file Cache.cc.
References a, and rtable_pair::rval.
Referenced by build_vol_hash_table().
void cplist_init | ( | ) |
Definition at line 2944 of file Cache.cc.
References ats_malloc(), CacheVol::disk_vols, CacheDisk::disk_vols, DiskVol::dpb_queue, Queue< C, L >::enqueue(), gndisks, DLL< C, L >::head, CacheDisk::header, ink_assert, DiskVol::num_volblocks, CacheVol::num_vols, DiskHeader::num_volumes, CacheVol::scheme, DiskVol::size, CacheVol::size, DiskVol::vol_number, and CacheVol::vol_number.
Referenced by CacheProcessor::diskInitialized(), and execute_and_verify().
int cplist_reconfigure | ( | ) |
Definition at line 3082 of file Cache.cc.
References ats_malloc(), CACHE_HTTP_TYPE, ConfigVol::cachep, ConfigVolumes::cp_queue, cplist_update(), create_volume(), CacheDisk::create_volume(), Debug, CacheDisk::delete_all_volumes(), CacheDisk::disk_vols, CacheVol::disk_vols, Queue< C, L >::enqueue(), fillExclusiveDisks(), CacheDisk::free_space, CacheDisk::get_diskvol(), gndisks, gnvol, DLL< C, L >::head, ConfigVol::in_percent, ink_assert, DiskVolBlock::len, Note, DiskVol::num_volblocks, CacheVol::num_vols, ConfigVolumes::num_volumes, ConfigVol::number, ConfigVol::percent, ConfigVol::scheme, CacheVol::scheme, ConfigVol::size, DiskVol::size, CacheVol::size, VOL_BLOCK_SIZE, DiskVol::vol_number, CacheVol::vol_number, and Warning.
Referenced by CacheProcessor::diskInitialized(), and execute_and_verify().
void cplist_update | ( | ) | [static] |
Definition at line 2983 of file Cache.cc.
References ConfigVol::cachep, ConfigVolumes::cp_queue, CacheDisk::delete_volume(), DiskVol::disk, CacheVol::disk_vols, CacheDisk::forced_volume_num, gndisks, DLL< C, L >::head, ConfigVol::number, Queue< C, L >::remove(), ConfigVol::scheme, CacheVol::scheme, CacheVol::size, ConfigVol::size, and CacheVol::vol_number.
Referenced by cplist_reconfigure().
int create_volume | ( | int | volume_number, | |
off_t | size_in_blocks, | |||
int | scheme, | |||
CacheVol * | cp | |||
) | [static] |
Definition at line 3300 of file Cache.cc.
References CacheDisk::create_volume(), Debug, CacheVol::disk_vols, fillExclusiveDisks(), CacheDisk::get_diskvol(), gndisks, ink_assert, DiskVolBlock::len, Note, CacheVol::num_vols, PATH_NAME_MAX, REC_ReadConfigString, CacheVol::scheme, CacheVol::size, VOL_BLOCK_SIZE, CacheVol::vol_number, and Warning.
Referenced by cplist_reconfigure().
static int fillExclusiveDisks | ( | CacheVol * | cp | ) | [static] |
Definition at line 3038 of file Cache.cc.
References CacheDisk::create_volume(), Debug, CacheDisk::delete_all_volumes(), CacheVol::disk_vols, CacheDisk::get_diskvol(), gndisks, DiskVolBlock::len, Note, CacheDisk::num_usable_blocks, CacheVol::num_vols, CacheVol::scheme, CacheVol::size, and CacheVol::vol_number.
Referenced by cplist_reconfigure(), and create_volume().
void ink_cache_init | ( | ModuleVersion | v | ) |
Definition at line 3478 of file Cache.cc.
References cache_config_agg_write_backlog, cache_config_alt_rewrite_max_size, cache_config_compatibility_4_2_0_fixup, cache_config_dir_sync_frequency, cache_config_enable_checksum, cache_config_force_sector_size, cache_config_hit_evacuate_percent, cache_config_hit_evacuate_size_limit, cache_config_http_max_alts, cache_config_max_disk_errors, cache_config_max_doc_size, cache_config_mutex_retry_delay, cache_config_permit_pinning, cache_config_ram_cache_algorithm, cache_config_ram_cache_compress, cache_config_ram_cache_compress_percent, cache_config_ram_cache_cutoff, cache_config_ram_cache_size, cache_config_ram_cache_use_seen_filter, cache_config_read_while_writer, cache_config_select_alternate, cache_config_target_fragment_size, cache_config_vary_on_user_agent, CACHE_MODULE_VERSION, cache_stat_count, checkModuleVersion(), Debug, ink_release_assert, Store::n_disks, Store::read_config(), REC_EstablishStaticConfigInt32, REC_EstablishStaticConfigInteger, REC_RegisterConfigUpdateFunc, RecAllocateRawStatBlock(), RecConfigReadConfigPath(), register_cache_stats(), update_cache_config(), validate_rww(), and Warning.
Referenced by main().
void rebuild_host_table | ( | Cache * | cache | ) | [static] |
Definition at line 3363 of file Cache.cc.
References build_vol_hash_table(), CacheHostTable::gen_host_rec, CacheHostMatcher::getDataArray(), CacheHostTable::getHostMatcher(), CacheHostMatcher::getNumElements(), Cache::hosttable, and CacheHostTable::m_numEntries.
Referenced by CacheProcessor::mark_storage_offline().
static void reg_int | ( | const char * | str, | |
int | stat, | |||
RecRawStatBlock * | rsb, | |||
const char * | prefix, | |||
RecRawStatSyncCb | sync_cb = RecRawStatSyncSum | |||
) | [static] |
Definition at line 3411 of file Cache.cc.
References DOCACHE_CLEAR_DYN_STAT, RECD_INT, RECP_NON_PERSISTENT, RecRegisterRawStat, and RECT_PROCESS.
Referenced by register_cache_stats().
void register_cache_stats | ( | RecRawStatBlock * | rsb, | |
const char * | prefix | |||
) |
Definition at line 3421 of file Cache.cc.
References cache_bytes_total_stat, cache_bytes_used_stat, cache_directory_collision_count_stat, cache_direntries_total_stat, cache_direntries_used_stat, cache_evacuate_active_stat, cache_evacuate_failure_stat, cache_evacuate_success_stat, cache_gc_bytes_evacuated_stat, cache_gc_frags_evacuated_stat, cache_hdr_marshal_bytes_stat, cache_hdr_marshal_stat, cache_hdr_vector_marshal_stat, cache_lookup_active_stat, cache_lookup_failure_stat, cache_lookup_success_stat, cache_percent_full_stat, cache_pread_count_stat, cache_ram_cache_bytes_stat, cache_ram_cache_bytes_total_stat, cache_ram_cache_hits_stat, cache_ram_cache_misses_stat, cache_read_active_stat, cache_read_busy_failure_stat, cache_read_busy_success_stat, cache_read_failure_stat, cache_read_success_stat, cache_remove_active_stat, cache_remove_failure_stat, cache_remove_success_stat, cache_scan_active_stat, cache_scan_failure_stat, cache_scan_success_stat, cache_single_fragment_document_count_stat, cache_stats_bytes_used_cb(), cache_three_plus_plus_fragment_document_count_stat, cache_two_fragment_document_count_stat, cache_update_active_stat, cache_update_failure_stat, cache_update_success_stat, cache_write_active_stat, cache_write_backlog_failure_stat, cache_write_bytes_stat, cache_write_failure_stat, cache_write_success_stat, REG_INT, and reg_int().
Referenced by CacheProcessor::diskInitialized(), and ink_cache_init().
Definition at line 285 of file Cache.cc.
References cache_config_read_while_writer, RecData::rec_int, and validate_rww().
Referenced by ink_cache_init().
static int validate_rww | ( | int | new_value | ) | [static] |
Definition at line 263 of file Cache.cc.
References cache_config_max_doc_size, Note, and REC_ReadConfigFloat.
Referenced by ink_cache_init(), and update_cache_config().
void vol_clear_init | ( | Vol * | d | ) |
Definition at line 1207 of file Cache.cc.
References VolHeaderFooter::agg_pos, VolHeaderFooter::create_time, VolHeaderFooter::cycle, VolHeaderFooter::dirty, Vol::disk, Vol::footer, Vol::header, CacheDisk::hw_sector_size, VersionNumber::ink_major, VersionNumber::ink_minor, VolHeaderFooter::last_write_pos, VolHeaderFooter::magic, VolHeaderFooter::phase, Vol::raw_dir, Vol::scan_pos, VolHeaderFooter::sector_size, Vol::sector_size, Vol::start, VolHeaderFooter::version, vol_dirlen(), vol_init_dir(), and VolHeaderFooter::write_pos.
Referenced by Vol::clear_dir(), and vol_dir_clear().
int vol_dir_clear | ( | Vol * | d | ) |
Definition at line 1232 of file Cache.cc.
References Vol::fd, Vol::hash_text, Vol::raw_dir, Vol::skip, vol_clear_init(), vol_dirlen(), and Warning.
Referenced by Cache_dir().
static void vol_init_data | ( | Vol * | d | ) | [static] |
Definition at line 1164 of file Cache.cc.
References vol_init_data_internal().
Referenced by Vol::init().
static void vol_init_data_internal | ( | Vol * | d | ) | [static] |
Definition at line 1155 of file Cache.cc.
References Vol::buckets, cache_config_min_average_object_size, DIR_DEPTH, Vol::len, Vol::segments, Vol::skip, Vol::start, and vol_dirlen().
Referenced by vol_init_data().
void vol_init_dir | ( | Vol * | d | ) |
Definition at line 1172 of file Cache.cc.
References Vol::buckets, dir_bucket(), dir_bucket_row(), dir_free_entry(), dir_segment, VolHeaderFooter::freelist, Vol::header, and Vol::segments.
Referenced by vol_clear_init().
int cache_config_agg_write_backlog = AGG_SIZE * 2 |
Definition at line 77 of file Cache.cc.
Referenced by CacheVC::handleWrite(), ink_cache_init(), and Vol::open_write().
int cache_config_alt_rewrite_max_size = 4096 |
Definition at line 79 of file Cache.cc.
Referenced by ink_cache_init().
int cache_config_dir_sync_frequency = 60 |
Definition at line 65 of file Cache.cc.
Referenced by dir_sync_init(), ink_cache_init(), and CacheSync::mainEvent().
int cache_config_enable_checksum = 0 |
Definition at line 78 of file Cache.cc.
Referenced by agg_copy(), CacheVC::handleReadDone(), and ink_cache_init().
int cache_config_force_sector_size = 0 |
Definition at line 75 of file Cache.cc.
Referenced by ink_cache_init(), and CacheProcessor::start_internal().
int cache_config_hit_evacuate_percent = 10 |
Definition at line 73 of file Cache.cc.
Referenced by Vol::init(), ink_cache_init(), CacheSync::mainEvent(), and sync_cache_dir_on_shutdown().
Definition at line 74 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadStartEarliest(), and CacheVC::openReadStartHead().
int cache_config_http_max_alts = 3 |
Definition at line 64 of file Cache.cc.
Referenced by ink_cache_init().
int cache_config_max_disk_errors = 5 |
Definition at line 72 of file Cache.cc.
Referenced by AIO_Callback_handler::handle_disk_failure(), and ink_cache_init().
int cache_config_max_doc_size = 0 |
Definition at line 69 of file Cache.cc.
Referenced by CacheVC::handleWrite(), ink_cache_init(), and validate_rww().
int cache_config_min_average_object_size = ESTIMATED_OBJECT_SIZE |
Definition at line 70 of file Cache.cc.
Referenced by Cache::open(), and vol_init_data_internal().
int cache_config_mutex_retry_delay = 2 |
Definition at line 81 of file Cache.cc.
Referenced by Vol::aggWriteDone(), Cache::deref(), CacheVC::derefRead(), CacheVC::handleWriteLock(), ink_cache_init(), CacheSync::mainEvent(), CacheVC::scanObject(), CacheVC::scanUpdateDone(), and OpenDir::signal_readers().
int cache_config_permit_pinning = 0 |
Definition at line 66 of file Cache.cc.
Referenced by ink_cache_init(), and Vol::scan_for_pinned_documents().
int cache_config_ram_cache_algorithm = 0 |
Definition at line 60 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized(), and ink_cache_init().
int cache_config_ram_cache_compress = 0 |
Definition at line 61 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized(), RamCacheCLFUS::compress_entries(), CacheVC::handleRead(), CacheVC::handleReadDone(), ink_cache_init(), and RamCacheCLFUSCompressor::mainEvent().
Definition at line 62 of file Cache.cc.
Referenced by RamCacheCLFUS::compress_entries(), ink_cache_init(), and RamCacheCLFUSCompressor::mainEvent().
int64_t cache_config_ram_cache_cutoff = AGG_SIZE |
Definition at line 71 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized(), CacheVC::handleReadDone(), and ink_cache_init().
int64_t cache_config_ram_cache_size = AUTO_SIZE_RAM_CACHE |
Definition at line 59 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized(), and ink_cache_init().
Definition at line 63 of file Cache.cc.
Referenced by ink_cache_init(), RamCacheLRU::put(), RamCacheCLFUS::put(), RamCacheLRU::resize_hashtable(), and RamCacheCLFUS::resize_hashtable().
int cache_config_read_while_writer = 0 |
Definition at line 80 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadChooseWriter(), CacheVC::openReadFromWriter(), and update_cache_config().
int cache_config_select_alternate = 1 |
Definition at line 68 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadChooseWriter(), and CacheVC::openReadStartHead().
int cache_config_target_fragment_size = DEFAULT_TARGET_FRAGMENT_SIZE |
Definition at line 76 of file Cache.cc.
Referenced by ink_cache_init(), and target_fragment_size().
int cache_config_vary_on_user_agent = 0 |
Definition at line 67 of file Cache.cc.
Referenced by ink_cache_init().
short int const CACHE_DB_MAJOR_VERSION_COMPATIBLE = 21 [static] |
RecRawStatBlock* cache_rsb = NULL |
CacheSync* cacheDirSync = 0 |
Definition at line 102 of file Cache.cc.
Referenced by Vol::aggWriteDone(), and dir_sync_init().
Definition at line 111 of file Cache.cc.
Referenced by cache(), TestProxy::cacheCheckEvent(), CB_After_Cache_Init(), CmdCacheCont::CheckEvent(), CmdCacheCont::ClearEvent(), cmd_check_internal(), cmd_clear(), ShowCache::delete_regex(), ShowCache::delete_url(), TestProxy::dnsEvent(), HttpSM::do_cache_delete_all_alts(), PrefetchBlaster::handleEvent(), ICPPeerReadCont::ICPPeerQueryCont(), ShowCache::invalidate_regex(), ShowCache::lookup_regex(), ShowCache::lookup_url(), main(), RegressionCont::mainEvent(), mgmt_storage_device_cmd_callback(), HttpCacheSM::open_write(), CacheDisk::openDone(), CacheVC::scanObject(), ClusterProcessor::start(), TSCacheDataTypeReady(), TSCacheRead(), TSCacheRemove(), TSCacheScan(), and TSCacheWrite().
ClassAllocator<CacheRemoveCont> cacheRemoveContAllocator("cacheRemoveCont") |
Definition at line 101 of file Cache.cc.
Referenced by cache_lookup_ClusterFunction(), cache_op_ClusterFunction(), Cache::deref(), Cache::link(), Cache::open_read(), Cache::open_write(), CacheContinuation::remoteOpEvent(), and CacheContinuation::setupReadWriteVC().
ClassAllocator<CacheVC> cacheVConnectionAllocator("cacheVConnection") |
Definition at line 206 of file Cache.cc.
Referenced by CacheHostRecord::Init().
int cp_list_len = 0 |
Definition at line 207 of file Cache.cc.
Referenced by CacheHostRecord::Init().
const int DEFAULT_CACHE_OPTIONS = (O_RDWR | _O_ATTRIB_OVERLAPPED) [static] |
size_t DEFAULT_RAM_CACHE_MULTIPLIER = 10 [static] |
Definition at line 45 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized().
ClassAllocator<EvacuationBlock> evacuationBlockAllocator("evacuationBlock") |
ClassAllocator<EvacuationKey> evacuationKeyAllocator("evacuationKey") |
Referenced by evacuate_fragments().
int gndisks = 0 |
Definition at line 99 of file Cache.cc.
Referenced by cplist_init(), cplist_reconfigure(), cplist_update(), create_config(), create_volume(), CacheProcessor::diskInitialized(), execute_and_verify(), fillExclusiveDisks(), CacheProcessor::find_by_path(), AIO_Callback_handler::handle_disk_failure(), CacheProcessor::has_online_storage(), Cache::open(), and CacheProcessor::start_internal().
volatile int gnvol = 0 |
Definition at line 113 of file Cache.cc.
Referenced by cache_bytes_used(), Cache_dir(), CacheProcessor::cacheInitialized(), cplist_reconfigure(), CacheProcessor::db_check(), CacheProcessor::dir_check(), Vol::dir_init_done(), CacheProcessor::diskInitialized(), CacheSync::mainEvent(), CacheProcessor::mark_storage_offline(), ShowCacheInternal::showSegSegment(), ShowCacheInternal::showVolEvacuations(), and sync_cache_dir_on_shutdown().
Definition at line 112 of file Cache.cc.
Referenced by Cache_dir(), CacheSync::mainEvent(), and sync_cache_dir_on_shutdown().
volatile int initialize_disk = 0 [static] |
Definition at line 100 of file Cache.cc.
Referenced by CacheProcessor::diskInitialized().
Definition at line 97 of file Cache.cc.
Referenced by CacheVC::scanVol().
Cache* theStreamCache = 0 |
Definition at line 125 of file Cache.cc.
Referenced by agg_copy(), Vol::force_evacuate_head(), new_DocEvacuator(), CacheVC::openReadStartEarliest(), CacheVC::scanObject(), and HttpTransactCache::SelectFromAlternates().