#include <P_CacheInternal.h>
Public Member Functions | |
int | open (bool reconfigure, bool fix) |
int | close () |
Action * | lookup (Continuation *cont, CacheKey *key, CacheFragType type, char const *hostname, int host_len) |
inkcoreapi Action * | open_read (Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int len) |
inkcoreapi Action * | open_write (Continuation *cont, CacheKey *key, CacheFragType frag_type, int options=0, time_t pin_in_cache=(time_t) 0, char *hostname=0, int host_len=0) |
inkcoreapi Action * | remove (Continuation *cont, CacheKey *key, CacheFragType type=CACHE_FRAG_TYPE_HTTP, bool user_agents=true, bool link=false, char *hostname=0, int host_len=0) |
Action * | scan (Continuation *cont, char *hostname=0, int host_len=0, int KB_per_second=2500) |
Action * | link (Continuation *cont, CacheKey *from, CacheKey *to, CacheFragType type, char *hostname, int host_len) |
Action * | deref (Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int host_len) |
void | vol_initialized (bool result) |
int | open_done () |
Vol * | key_to_vol (CacheKey *key, char const *hostname, int host_len) |
Cache () | |
Data Fields | |
volatile int | cache_read_done |
volatile int | total_good_nvol |
volatile int | total_nvol |
volatile int | ready |
int64_t | cache_size |
CacheHostTable * | hosttable |
volatile int | total_initialized_vol |
CacheType | scheme |
Definition at line 1013 of file P_CacheInternal.h.
Cache::Cache | ( | ) | [inline] |
Definition at line 1064 of file P_CacheInternal.h.
Action * Cache::deref | ( | Continuation * | cont, | |
CacheKey * | key, | |||
CacheFragType | type, | |||
char * | hostname, | |||
int | host_len | |||
) |
Definition at line 75 of file CacheLink.cc.
References CacheVC::_action, ACTION_RESULT_DONE, AIO_EVENT_DONE, cache_config_mutex_retry_delay, CACHE_EVENT_DEREF_FAILED, caches, CacheVC::derefRead(), CacheVC::dir, dir_probe(), CacheVC::do_read_call(), ECACHE_NO_DOC, EVENT_DONE, EVENT_RETURN, CacheVC::first_key, Continuation::handleEvent(), HRTIME_MSECONDS, ink_assert, CacheProcessor::IsCacheReady(), CacheVC::key, key_to_vol(), CacheVC::last_collision, Continuation::mutex, MUTEX_TRY_LOCK, new_CacheVC(), SET_CONTINUATION_HANDLER, and CacheVC::vol.
Referenced by cache_op_ClusterFunction().
Definition at line 3379 of file Cache.cc.
References Debug, CacheHostTable::gen_host_rec, hosttable, is_debug_tag_set, CacheHostTable::m_numEntries, CacheHostTable::Match(), CacheHostResult::record, ats::CryptoHash::slice32(), CacheHostRecord::vol_hash_table, VOL_HASH_TABLE_SIZE, and CacheHostRecord::vols.
Referenced by deref(), link(), lookup(), open_read(), open_write(), and remove().
Action * Cache::link | ( | Continuation * | cont, | |
CacheKey * | from, | |||
CacheKey * | to, | |||
CacheFragType | type, | |||
char * | hostname, | |||
int | host_len | |||
) |
Definition at line 27 of file CacheLink.cc.
References CacheVC::_action, ACTION_RESULT_DONE, CacheVC::buf, BUFFER_SIZE_INDEX_512, CACHE_EVENT_LINK_FAILED, caches, Doc::data(), CacheVC::do_write_lock(), CacheVC::earliest_key, CacheVC::f, CacheVC::first_key, Continuation::handleEvent(), ink_assert, CacheProcessor::IsCacheReady(), key_to_vol(), CacheVC::linkWrite(), memcpy, new_CacheVC(), new_IOBufferData, SET_CONTINUATION_HANDLER, CacheVC::vol, and CacheVC::write_len.
Referenced by cache_op_ClusterFunction().
Action * Cache::lookup | ( | Continuation * | cont, | |
CacheKey * | key, | |||
CacheFragType | type, | |||
char const * | hostname, | |||
int | host_len | |||
) |
Definition at line 2776 of file Cache.cc.
References CacheVC::_action, ACTION_RESULT_DONE, CacheVC::base_stat, CACHE_EVENT_LOOKUP_FAILED, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, EVENT_INTERVAL, CacheVC::f, CacheVC::first_key, CacheVC::frag_type, Continuation::handleEvent(), CacheProcessor::IsCacheReady(), CacheVC::key, key_to_vol(), CacheVC::last_collision, Continuation::mutex, new_CacheVC(), VIO::op, CacheVC::openReadStartHead(), SET_CONTINUATION_HANDLER, CacheVC::vio, and CacheVC::vol.
Referenced by cache_lookup_ClusterFunction(), and CacheContinuation::remoteOpEvent().
int Cache::open | ( | bool | reconfigure, | |
bool | fix | |||
) |
Definition at line 2291 of file Cache.cc.
References ats_malloc(), DiskVolBlockQueue::b, Vol::cache, cache_config_min_average_object_size, cache_read_done, cache_size, Vol::cache_vol, CacheDisk::cleared, Debug, Vol::disk, DiskVol::disk, DISK_BAD, CacheVol::disk_vols, DiskVol::dpb_queue, eventProcessor, CacheDisk::fd, Vol::fd, gndisks, DLL< C, L >::head, Vol::init(), DiskVolBlock::len, DiskVolBlockQueue::new_block, CacheVol::num_vols, DiskVolBlock::offset, open_done(), CacheDisk::path, REC_EstablishStaticConfigInt32, EventProcessor::schedule_imm(), scheme, CacheVol::scheme, total_good_nvol, total_initialized_vol, total_nvol, and CacheVol::vols.
Referenced by CacheProcessor::diskInitialized().
int Cache::open_done | ( | ) |
Definition at line 2267 of file Cache.cc.
References CacheProcessor::cacheInitialized(), CacheHostTable::gen_host_rec, hosttable, CacheHostRecord::num_cachevols, ready, CacheHostTable::register_config_callback(), StatPagesManager::register_http(), register_ShowCache(), register_ShowCacheInternal(), scheme, statPagesManager, and total_good_nvol.
Referenced by open(), and vol_initialized().
Action * Cache::open_read | ( | Continuation * | cont, | |
CacheKey * | key, | |||
CacheFragType | type, | |||
char * | hostname, | |||
int | len | |||
) |
Definition at line 34 of file CacheRead.cc.
References CacheVC::_action, ACTION_RESULT_DONE, AIO_EVENT_DONE, CacheVC::base_stat, CACHE_EVENT_OPEN_READ_FAILED, CACHE_INCREMENT_DYN_STAT, cache_read_failure_stat, CACHE_STAT_ACTIVE, CACHE_TRY_LOCK, caches, CONT_SCHED_LOCK_RETRY, CacheVC::dir, dir_probe(), CacheVC::do_read_call(), CacheVC::earliest_key, ECACHE_NO_DOC, ECACHE_NOT_READY, EVENT_DONE, EVENT_IMMEDIATE, EVENT_RETURN, CacheVC::first_key, CacheVC::frag_type, Continuation::handleEvent(), ink_assert, CacheProcessor::IsCacheReady(), CacheVC::key, key_to_vol(), CacheVC::last_collision, Continuation::mutex, new_CacheVC(), CacheVC::od, VIO::op, Vol::open_read(), CacheVC::openReadFromWriter(), CacheVC::openReadStartHead(), SET_CONTINUATION_HANDLER, ProxyMutex::thread_holding, CacheVC::vio, and CacheVC::vol.
Referenced by cache_op_ClusterFunction().
Action * Cache::open_write | ( | Continuation * | cont, | |
CacheKey * | key, | |||
CacheFragType | frag_type, | |||
int | options = 0 , |
|||
time_t | pin_in_cache = (time_t) 0 , |
|||
char * | hostname = 0 , |
|||
int | host_len = 0 | |||
) |
Definition at line 1618 of file CacheWrite.cc.
References CacheVC::_action, ACTION_RESULT_DONE, CacheVC::base_stat, CACHE_EVENT_OPEN_WRITE, CACHE_EVENT_OPEN_WRITE_FAILED, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, CACHE_STAT_FAILURE, CACHE_WRITE_OPT_SYNC, caches, CacheVC::callcont(), CONT_SCHED_LOCK_RETRY, DIR_MASK_TAG, CacheVC::earliest_key, ECACHE_NOT_READY, EVENT_IMMEDIATE, CacheVC::f, CacheVC::first_key, CacheVC::frag_type, free_CacheVC(), Continuation::handleEvent(), CacheVC::info, ink_assert, CacheProcessor::IsCacheReady(), CacheVC::key, key_to_vol(), Continuation::mutex, MUTEX_LOCK, new_CacheVC(), VIO::op, Vol::open_write_lock(), CacheVC::openWriteMain(), CacheVC::openWriteOverwrite(), CacheVC::openWriteStartBegin(), CacheVC::pin_in_cache, rand_CacheKey(), SET_CONTINUATION_HANDLER, ats::CryptoHash::slice32(), this_ethread(), CacheVC::trigger, CacheVC::vio, and CacheVC::vol.
Referenced by cache_op_ClusterFunction(), and CacheContinuation::setupReadWriteVC().
Action * Cache::remove | ( | Continuation * | cont, | |
CacheKey * | key, | |||
CacheFragType | type = CACHE_FRAG_TYPE_HTTP , |
|||
bool | user_agents = true , |
|||
bool | link = false , |
|||
char * | hostname = 0 , |
|||
int | host_len = 0 | |||
) |
Definition at line 2896 of file Cache.cc.
References CacheVC::_action, CacheVC::base_stat, CACHE_EVENT_REMOVE_FAILED, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, CACHE_TRY_LOCK, CacheVC::dir, dir_clear, EVENT_DONE, EVENT_IMMEDIATE, CacheVC::f, CacheVC::first_key, CacheVC::frag_type, Continuation::handleEvent(), ink_assert, CacheProcessor::IsCacheReady(), CacheVC::key, key_to_vol(), Continuation::mutex, new_CacheRemoveCont(), new_CacheVC(), VIO::op, CacheVC::removeEvent(), SET_CONTINUATION_HANDLER, this_ethread(), CacheVC::vio, and CacheVC::vol.
Referenced by cache_op_ClusterFunction().
Action * Cache::scan | ( | Continuation * | cont, | |
char * | hostname = 0 , |
|||
int | host_len = 0 , |
|||
int | KB_per_second = 2500 | |||
) |
Definition at line 32 of file CacheVol.cc.
References CacheVC::_action, CacheVC::base_stat, CacheVC::buf, BUFFER_SIZE_FOR_XMALLOC, CACHE_EVENT_SCAN, CACHE_EVENT_SCAN_FAILED, CACHE_FRAG_TYPE_HTTP, Debug, eventProcessor, Continuation::handleEvent(), CacheVC::host_len, CacheVC::hostname, HRTIME_MSECONDS, CacheProcessor::IsCacheReady(), MEMALIGNED, new_CacheVC(), new_IOBufferData, CacheVC::offset, SCAN_BUF_SIZE, CacheVC::scan_msec_delay, CacheVC::scanVol(), EventProcessor::schedule_in(), SET_CONTINUATION_HANDLER, and CacheVC::vol.
void Cache::vol_initialized | ( | bool | result | ) |
Definition at line 2138 of file Cache.cc.
References open_done(), total_good_nvol, total_initialized_vol, and total_nvol.
Referenced by Vol::dir_init_done().
volatile int Cache::cache_read_done |
Definition at line 1015 of file P_CacheInternal.h.
Referenced by Vol::dir_init_done(), and open().
int64_t Cache::cache_size |
Definition at line 1019 of file P_CacheInternal.h.
Referenced by CacheProcessor::cacheInitialized(), and open().
Definition at line 1020 of file P_CacheInternal.h.
Referenced by key_to_vol(), CacheProcessor::mark_storage_offline(), open_done(), rebuild_host_table(), and CacheVC::scanVol().
volatile int Cache::ready |
Definition at line 1018 of file P_CacheInternal.h.
Referenced by CacheProcessor::cacheInitialized(), and open_done().
Definition at line 1022 of file P_CacheInternal.h.
Referenced by CacheProcessor::diskInitialized(), open(), and open_done().
volatile int Cache::total_good_nvol |
Definition at line 1016 of file P_CacheInternal.h.
Referenced by open(), open_done(), and vol_initialized().
volatile int Cache::total_initialized_vol |
Definition at line 1021 of file P_CacheInternal.h.
Referenced by open(), and vol_initialized().
volatile int Cache::total_nvol |
Definition at line 1017 of file P_CacheInternal.h.
Referenced by open(), and vol_initialized().