Data Structures | Defines | Enumerations | Functions | Variables

P_CacheInternal.h File Reference

A brief file description. More...

#include "libts.h"
Include dependency graph for P_CacheInternal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CacheVC
struct  CacheRemoveCont
struct  Cache

Defines

#define ALTERNATES   1
#define MAX_CACHE_VCS_PER_THREAD   500
#define INTEGRAL_FRAGS   4
#define DDebug   if (0) dummy_debug
#define AIO_SOFT_FAILURE   -100000
#define WRITER_RETRY_DELAY   HRTIME_MSECONDS(50)
#define CACHE_TRY_LOCK(_l, _m, _t)   MUTEX_TRY_LOCK(_l, _m, _t)
#define VC_LOCK_RETRY_EVENT()
#define VC_SCHED_LOCK_RETRY()
#define CONT_SCHED_LOCK_RETRY_RET(_c)
#define CONT_SCHED_LOCK_RETRY(_c)   _c->mutex->thread_holding->schedule_in_local(_c, HRTIME_MSECONDS(cache_config_mutex_retry_delay))
#define VC_SCHED_WRITER_RETRY()
#define GLOBAL_CACHE_SET_DYN_STAT(x, y)   RecSetGlobalRawStatSum(cache_rsb, (x), (y))
#define CACHE_SET_DYN_STAT(x, y)
#define CACHE_INCREMENT_DYN_STAT(x)
#define CACHE_DECREMENT_DYN_STAT(x)
#define CACHE_VOL_SUM_DYN_STAT(x, y)   RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), (int64_t) y);
#define CACHE_SUM_DYN_STAT(x, y)
#define CACHE_SUM_DYN_STAT_THREAD(x, y)
#define GLOBAL_CACHE_SUM_GLOBAL_DYN_STAT(x, y)   RecIncrGlobalRawStatSum(cache_rsb,(x),(y))
#define CACHE_SUM_GLOBAL_DYN_STAT(x, y)
#define CACHE_CLEAR_DYN_STAT(x)
#define CACHE_STAT_ACTIVE   0
#define CACHE_STAT_SUCCESS   1
#define CACHE_STAT_FAILURE   2
#define PUSH_HANDLER(_x)
#define POP_HANDLER
#define CACHE_DEBUG_INCREMENT_DYN_STAT(_x)
#define CACHE_DEBUG_SUM_DYN_STAT(_x, _y)

Enumerations

enum  {
  cache_bytes_used_stat, cache_bytes_total_stat, cache_ram_cache_bytes_stat, cache_ram_cache_bytes_total_stat,
  cache_direntries_total_stat, cache_direntries_used_stat, cache_ram_cache_hits_stat, cache_ram_cache_misses_stat,
  cache_pread_count_stat, cache_percent_full_stat, cache_lookup_active_stat, cache_lookup_success_stat,
  cache_lookup_failure_stat, cache_read_active_stat, cache_read_success_stat, cache_read_failure_stat,
  cache_write_active_stat, cache_write_success_stat, cache_write_failure_stat, cache_write_backlog_failure_stat,
  cache_update_active_stat, cache_update_success_stat, cache_update_failure_stat, cache_remove_active_stat,
  cache_remove_success_stat, cache_remove_failure_stat, cache_evacuate_active_stat, cache_evacuate_success_stat,
  cache_evacuate_failure_stat, cache_scan_active_stat, cache_scan_success_stat, cache_scan_failure_stat,
  cache_directory_collision_count_stat, cache_single_fragment_document_count_stat, cache_two_fragment_document_count_stat, cache_three_plus_plus_fragment_document_count_stat,
  cache_read_busy_success_stat, cache_read_busy_failure_stat, cache_gc_bytes_evacuated_stat, cache_gc_frags_evacuated_stat,
  cache_write_bytes_stat, cache_hdr_vector_marshal_stat, cache_hdr_marshal_stat, cache_hdr_marshal_bytes_stat,
  cache_stat_count
}

Functions

CacheVCnew_DocEvacuator (int nbytes, Vol *d)
TS_INLINE CacheVCnew_CacheVC (Continuation *cont)
TS_INLINE int free_CacheVC (CacheVC *cont)
TS_INLINE int dir_delete_lock (CacheKey *key, Vol *d, ProxyMutex *m, Dir *del)
TS_INLINE int dir_insert_lock (CacheKey *key, Vol *d, Dir *to_part, ProxyMutex *m)
TS_INLINE int dir_overwrite_lock (CacheKey *key, Vol *d, Dir *to_part, ProxyMutex *m, Dir *overwrite, bool must_overwrite=true)
void TS_INLINE rand_CacheKey (CacheKey *next_key, ProxyMutex *mutex)
void TS_INLINE next_CacheKey (CacheKey *next_key, CacheKey *key)
void TS_INLINE prev_CacheKey (CacheKey *prev_key, CacheKey *key)
TS_INLINE unsigned int next_rand (unsigned int *p)
TS_INLINE CacheRemoveContnew_CacheRemoveCont ()
TS_INLINE void free_CacheRemoveCont (CacheRemoveCont *cache_rm)
int64_t cache_bytes_used (void)
int64_t cache_bytes_total (void)
TS_INLINE unsigned int cache_hash (INK_MD5 &md5)
TS_INLINE Cachelocal_cache ()

Variables

RecRawStatBlockcache_rsb
int cache_config_dir_sync_frequency
int cache_config_http_max_alts
int cache_config_permit_pinning
int cache_config_select_alternate
int cache_config_vary_on_user_agent
int cache_config_max_doc_size
int cache_config_min_average_object_size
int cache_config_agg_write_backlog
int cache_config_enable_checksum
int cache_config_alt_rewrite_max_size
int cache_config_read_while_writer
int cache_clustering_enabled
int cache_config_ram_cache_compress
int cache_config_ram_cache_compress_percent
int cache_config_ram_cache_use_seen_filter
int cache_config_hit_evacuate_percent
int cache_config_hit_evacuate_size_limit
int cache_config_force_sector_size
int cache_config_target_fragment_size
int cache_config_mutex_retry_delay
ClassAllocator< CacheVCcacheVConnectionAllocator
CacheKey zero_key
CacheSynccacheDirSync
uint8_t CacheKey_next_table []
uint8_t CacheKey_prev_table []
ClassAllocator< CacheRemoveContcacheRemoveContAllocator
CachetheCache
CachetheStreamCache
inkcoreapi Cachecaches [NUM_CACHE_FRAG_TYPES]

Detailed Description

A brief file description.

License

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 P_CacheInternal.h.


Define Documentation

#define AIO_SOFT_FAILURE   -100000

Definition at line 59 of file P_CacheInternal.h.

#define ALTERNATES   1

Definition at line 39 of file P_CacheInternal.h.

#define CACHE_CLEAR_DYN_STAT (   x  ) 
Value:
do { \
        RecSetRawStatSum(cache_rsb, (x), 0); \
        RecSetRawStatCount(cache_rsb, (x), 0); \
        RecSetRawStatSum(vol->cache_vol->vol_rsb, (x), 0); \
        RecSetRawStatCount(vol->cache_vol->vol_rsb, (x), 0); \
} while (0);

Definition at line 202 of file P_CacheInternal.h.

#define CACHE_DEBUG_INCREMENT_DYN_STAT (   _x  ) 

Definition at line 1005 of file P_CacheInternal.h.

Referenced by agg_copy(), and CacheVC::handleRead().

#define CACHE_DEBUG_SUM_DYN_STAT (   _x,
  _y 
)

Definition at line 1006 of file P_CacheInternal.h.

Referenced by agg_copy().

#define CACHE_DECREMENT_DYN_STAT (   x  ) 
Value:
RecIncrRawStat(cache_rsb, mutex->thread_holding, (int) (x), -1); \
        RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), -1);

Definition at line 180 of file P_CacheInternal.h.

Referenced by free_CacheVC().

#define CACHE_INCREMENT_DYN_STAT (   x  ) 
#define CACHE_SET_DYN_STAT (   x,
  y 
)
Value:
RecSetGlobalRawStatSum(cache_rsb, (x), (y)) \
        RecSetGlobalRawStatSum(vol->cache_vol->vol_rsb, (x), (y))

Definition at line 172 of file P_CacheInternal.h.

#define CACHE_STAT_ACTIVE   0
#define CACHE_STAT_FAILURE   2
#define CACHE_STAT_SUCCESS   1

Definition at line 377 of file P_CacheInternal.h.

Referenced by free_CacheVC().

#define CACHE_SUM_DYN_STAT (   x,
  y 
)
Value:
RecIncrRawStat(cache_rsb, mutex->thread_holding, (int) (x), (int64_t) (y)); \
        RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), (int64_t) (y));

Definition at line 187 of file P_CacheInternal.h.

#define CACHE_SUM_DYN_STAT_THREAD (   x,
  y 
)
#define CACHE_SUM_GLOBAL_DYN_STAT (   x,
  y 
)
Value:
RecIncrGlobalRawStatSum(cache_rsb,(x),(y)) \
        RecIncrGlobalRawStatSum(vol->cache_vol->vol_rsb,(x),(y))

Definition at line 198 of file P_CacheInternal.h.

#define CACHE_TRY_LOCK (   _l,
  _m,
  _t 
)    MUTEX_TRY_LOCK(_l, _m, _t)
#define CACHE_VOL_SUM_DYN_STAT (   x,
  y 
)    RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), (int64_t) y);

Definition at line 184 of file P_CacheInternal.h.

Referenced by CacheProcessor::cacheInitialized().

#define CONT_SCHED_LOCK_RETRY (   _c  )     _c->mutex->thread_holding->schedule_in_local(_c, HRTIME_MSECONDS(cache_config_mutex_retry_delay))
#define CONT_SCHED_LOCK_RETRY_RET (   _c  ) 
#define DDebug   if (0) dummy_debug
#define GLOBAL_CACHE_SET_DYN_STAT (   x,
  y 
)    RecSetGlobalRawStatSum(cache_rsb, (x), (y))

Definition at line 169 of file P_CacheInternal.h.

Referenced by CacheProcessor::cacheInitialized().

#define GLOBAL_CACHE_SUM_GLOBAL_DYN_STAT (   x,
  y 
)    RecIncrGlobalRawStatSum(cache_rsb,(x),(y))

Definition at line 195 of file P_CacheInternal.h.

#define INTEGRAL_FRAGS   4

Definition at line 45 of file P_CacheInternal.h.

#define MAX_CACHE_VCS_PER_THREAD   500

Definition at line 43 of file P_CacheInternal.h.

#define POP_HANDLER
Value:
do {                                          \
    handler = save_handler;                                       \
    ink_assert(handler != (ContinuationHandler)(&CacheVC::dead)); \
  } while (0)

Definition at line 519 of file P_CacheInternal.h.

#define PUSH_HANDLER (   _x  ) 
Value:
do {                                           \
    ink_assert(handler != (ContinuationHandler)(&CacheVC::dead));       \
    save_handler = handler; handler = (ContinuationHandler)(_x);        \
} while (0)

Definition at line 514 of file P_CacheInternal.h.

Referenced by CacheVC::do_read_call(), CacheVC::do_write_call(), CacheVC::do_write_lock(), and CacheVC::do_write_lock_call().

#define VC_LOCK_RETRY_EVENT (  ) 
Value:
do { \
    trigger = mutex->thread_holding->schedule_in_local(this, HRTIME_MSECONDS(cache_config_mutex_retry_delay), event); \
    return EVENT_CONT; \
  } while (0)

Definition at line 74 of file P_CacheInternal.h.

Referenced by CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseHeadDone(), CacheVC::openWriteOverwrite(), and CacheVC::openWriteWriteDone().

#define VC_SCHED_LOCK_RETRY (  ) 
#define VC_SCHED_WRITER_RETRY (  ) 
Value:
do { \
    ink_assert(!trigger); \
    writer_lock_retry++; \
    ink_hrtime _t = WRITER_RETRY_DELAY; \
    if (writer_lock_retry > 2) \
      _t = WRITER_RETRY_DELAY * 2; \
    else if (writer_lock_retry > 5) \
      _t = WRITER_RETRY_DELAY * 10; \
    else if (writer_lock_retry > 10) \
      _t = WRITER_RETRY_DELAY * 100; \
    trigger = mutex->thread_holding->schedule_in_local(this, _t); \
    return EVENT_CONT; \
  } while (0)

Definition at line 95 of file P_CacheInternal.h.

Referenced by CacheVC::openReadFromWriter(), CacheVC::openReadMain(), and CacheVC::openReadReadDone().

#define WRITER_RETRY_DELAY   HRTIME_MSECONDS(50)

Definition at line 61 of file P_CacheInternal.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
cache_bytes_used_stat 
cache_bytes_total_stat 
cache_ram_cache_bytes_stat 
cache_ram_cache_bytes_total_stat 
cache_direntries_total_stat 
cache_direntries_used_stat 
cache_ram_cache_hits_stat 
cache_ram_cache_misses_stat 
cache_pread_count_stat 
cache_percent_full_stat 
cache_lookup_active_stat 
cache_lookup_success_stat 
cache_lookup_failure_stat 
cache_read_active_stat 
cache_read_success_stat 
cache_read_failure_stat 
cache_write_active_stat 
cache_write_success_stat 
cache_write_failure_stat 
cache_write_backlog_failure_stat 
cache_update_active_stat 
cache_update_success_stat 
cache_update_failure_stat 
cache_remove_active_stat 
cache_remove_success_stat 
cache_remove_failure_stat 
cache_evacuate_active_stat 
cache_evacuate_success_stat 
cache_evacuate_failure_stat 
cache_scan_active_stat 
cache_scan_success_stat 
cache_scan_failure_stat 
cache_directory_collision_count_stat 
cache_single_fragment_document_count_stat 
cache_two_fragment_document_count_stat 
cache_three_plus_plus_fragment_document_count_stat 
cache_read_busy_success_stat 
cache_read_busy_failure_stat 
cache_gc_bytes_evacuated_stat 
cache_gc_frags_evacuated_stat 
cache_write_bytes_stat 
cache_hdr_vector_marshal_stat 
cache_hdr_marshal_stat 
cache_hdr_marshal_bytes_stat 
cache_stat_count 

Definition at line 112 of file P_CacheInternal.h.


Function Documentation

int64_t cache_bytes_total ( void   ) 
int64_t cache_bytes_used ( void   ) 
TS_INLINE unsigned int cache_hash ( INK_MD5 md5  ) 
TS_INLINE int dir_delete_lock ( CacheKey key,
Vol d,
ProxyMutex m,
Dir del 
)
TS_INLINE int dir_insert_lock ( CacheKey key,
Vol d,
Dir to_part,
ProxyMutex m 
)
TS_INLINE int dir_overwrite_lock ( CacheKey key,
Vol d,
Dir to_part,
ProxyMutex m,
Dir overwrite,
bool  must_overwrite = true 
)
TS_INLINE void free_CacheRemoveCont ( CacheRemoveCont cache_rm  ) 

Definition at line 983 of file P_CacheInternal.h.

References ClassAllocator< C >::free(), and Continuation::mutex.

Referenced by CacheRemoveCont::event_handler().

TS_INLINE int free_CacheVC ( CacheVC cont  ) 

Definition at line 573 of file P_CacheInternal.h.

References CacheVC::_action, AIOCallback::action, ink_aiocb::aio_nbytes, ink_aiocb::aio_reqprio, AIOCallback::aio_result, AIOCallback::aiocb, CacheVC::alternate, CacheVC::alternate_index, ats_free(), CacheVC::base_stat, CacheVC::blocks, CacheVC::buf, VIO::buffer, CACHE_ALT_INDEX_DEFAULT, CACHE_DECREMENT_DYN_STAT, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, CACHE_STAT_SUCCESS, Action::cancel(), Action::cancelled, MIOBufferAccessor::clear(), CacheHTTPInfoVector::clear(), Ptr< T >::clear(), CacheVC::closed, Action::continuation, CacheVC::dead(), Debug, CacheVC::f, CacheVC::first_buf, ink_assert, CacheVC::io, CacheVC::is_io_in_progress(), VIO::mutex, Action::mutex, Continuation::mutex, CacheVC::od, VIO::op, VIO::READ, CacheVC::scan_vol_map, SET_CONTINUATION_HANDLER, CacheVC::size_to_init, this_ethread(), this_thread(), THREAD_FREE, ProxyMutex::thread_holding, CacheVC::trigger, CacheVC::vector, CacheVC::vio, CacheVC::vol, VIO::WRITE, and CacheVC::writer_buf.

Referenced by CacheVC::derefRead(), dir_lookaside_cleanup(), CacheVC::evacuateDocDone(), Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), CacheVC::linkWrite(), Cache::open_write(), CacheVC::openReadClose(), CacheVC::openReadFromWriter(), CacheVC::openReadFromWriterFailure(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), CacheVC::openWriteStartBegin(), CacheVC::removeEvent(), CacheVC::scanObject(), and CacheVC::scanVol().

TS_INLINE Cache* local_cache (  ) 

Definition at line 1355 of file P_CacheInternal.h.

TS_INLINE CacheRemoveCont* new_CacheRemoveCont (  ) 
TS_INLINE CacheVC* new_CacheVC ( Continuation cont  ) 
CacheVC* new_DocEvacuator ( int  nbytes,
Vol d 
)
void TS_INLINE next_CacheKey ( CacheKey next_key,
CacheKey key 
)
TS_INLINE unsigned int next_rand ( unsigned int *  p  ) 
void TS_INLINE prev_CacheKey ( CacheKey prev_key,
CacheKey key 
)

Definition at line 952 of file P_CacheInternal.h.

Referenced by agg_copy(), and CacheVC::openReadMain().

void TS_INLINE rand_CacheKey ( CacheKey next_key,
ProxyMutex mutex 
)

Variable Documentation

Definition at line 223 of file P_CacheInternal.h.

Referenced by CacheVC::handleWrite(), ink_cache_init(), and Vol::open_write().

Definition at line 79 of file Cache.cc.

Referenced by ink_cache_init().

Definition at line 65 of file Cache.cc.

Referenced by dir_sync_init(), ink_cache_init(), and CacheSync::mainEvent().

Definition at line 78 of file Cache.cc.

Referenced by agg_copy(), CacheVC::handleReadDone(), and ink_cache_init().

Definition at line 75 of file Cache.cc.

Referenced by ink_cache_init(), and CacheProcessor::start_internal().

Definition at line 64 of file Cache.cc.

Referenced by ink_cache_init().

Definition at line 69 of file Cache.cc.

Referenced by CacheVC::handleWrite(), ink_cache_init(), and validate_rww().

Definition at line 70 of file Cache.cc.

Referenced by Cache::open(), and vol_init_data_internal().

Definition at line 66 of file Cache.cc.

Referenced by ink_cache_init(), and Vol::scan_for_pinned_documents().

Definition at line 76 of file Cache.cc.

Referenced by ink_cache_init(), and target_fragment_size().

Definition at line 67 of file Cache.cc.

Definition at line 95 of file Cache.cc.

Definition at line 102 of file Cache.cc.

Referenced by Vol::aggWriteDone(), and dir_sync_init().

Definition at line 1318 of file CacheDir.cc.

Definition at line 1354 of file CacheDir.cc.

inkcoreapi Cache* caches[NUM_CACHE_FRAG_TYPES]

Definition at line 97 of file Cache.cc.

Referenced by CacheVC::scanVol().

Definition at line 96 of file Cache.cc.