Data Structures | Namespaces | Defines | Functions | Variables

Cache.cc File Reference

A brief file description. More...

#include "P_Cache.h"
#include "P_CacheTest.h"
#include "StatPages.h"
#include "I_Layout.h"
Include dependency graph for Cache.cc:

Go to the source code of this file.

Data Structures

struct  VolInitInfo
struct  rtable_pair

Namespaces

namespace  cache_bc

Defines

#define USELESS_REENABLES
#define DOCACHE_CLEAR_DYN_STAT(x)
#define STORE_COLLISION   1
#define REG_INT(_str, _stat)   reg_int(_str, (int)_stat, rsb, prefix)

Functions

void cplist_init ()
static void cplist_update ()
int cplist_reconfigure ()
static int create_volume (int volume_number, off_t size_in_blocks, int scheme, CacheVol *cp)
static void rebuild_host_table (Cache *cache)
void register_cache_stats (RecRawStatBlock *rsb, const char *prefix)
int64_t cache_bytes_used (int volume)
int cache_stats_bytes_used_cb (const char *name, RecDataT data_type, RecData *data, RecRawStatBlock *rsb, int id)
static int validate_rww (int new_value)
static int update_cache_config (const char *, RecDataT, RecData data, void *)
static void vol_init_data_internal (Vol *d)
static void vol_init_data (Vol *d)
void vol_init_dir (Vol *d)
void vol_clear_init (Vol *d)
int vol_dir_clear (Vol *d)
static int cmprtable (const void *aa, const void *bb)
void build_vol_hash_table (CacheHostRecord *cp)
static int fillExclusiveDisks (CacheVol *cp)
static void reg_int (const char *str, int stat, RecRawStatBlock *rsb, const char *prefix, RecRawStatSyncCb sync_cb=RecRawStatSyncSum)
void ink_cache_init (ModuleVersion v)

Variables

static size_t DEFAULT_RAM_CACHE_MULTIPLIER = 10
static short int const CACHE_DB_MAJOR_VERSION_COMPATIBLE = 21
int64_t cache_config_ram_cache_size = AUTO_SIZE_RAM_CACHE
int cache_config_ram_cache_algorithm = 0
int cache_config_ram_cache_compress = 0
int cache_config_ram_cache_compress_percent = 90
int cache_config_ram_cache_use_seen_filter = 0
int cache_config_http_max_alts = 3
int cache_config_dir_sync_frequency = 60
int cache_config_permit_pinning = 0
int cache_config_vary_on_user_agent = 0
int cache_config_select_alternate = 1
int cache_config_max_doc_size = 0
int cache_config_min_average_object_size = ESTIMATED_OBJECT_SIZE
int64_t cache_config_ram_cache_cutoff = AGG_SIZE
int cache_config_max_disk_errors = 5
int cache_config_hit_evacuate_percent = 10
int cache_config_hit_evacuate_size_limit = 0
int cache_config_force_sector_size = 0
int cache_config_target_fragment_size = DEFAULT_TARGET_FRAGMENT_SIZE
int cache_config_agg_write_backlog = AGG_SIZE * 2
int cache_config_enable_checksum = 0
int cache_config_alt_rewrite_max_size = 4096
int cache_config_read_while_writer = 0
int cache_config_mutex_retry_delay = 2
RecRawStatBlockcache_rsb = NULL
CachetheStreamCache = 0
CachetheCache = 0
CacheDisk ** gdisks = NULL
int gndisks = 0
static volatile int initialize_disk = 0
Cachecaches [NUM_CACHE_FRAG_TYPES] = { 0 }
CacheSynccacheDirSync = 0
Store theCacheStore
CacheProcessor cacheProcessor
Vol ** gvol = NULL
volatile int gnvol = 0
ClassAllocator< CacheVCcacheVConnectionAllocator ("cacheVConnection")
ClassAllocator< EvacuationBlockevacuationBlockAllocator ("evacuationBlock")
ClassAllocator< CacheRemoveContcacheRemoveContAllocator ("cacheRemoveCont")
ClassAllocator< EvacuationKeyevacuationKeyAllocator ("evacuationKey")
CacheKey zero_key
Queue< CacheVolcp_list
int cp_list_len = 0
ConfigVolumes config_volumes
static const int DEFAULT_CACHE_OPTIONS = (O_RDWR | _O_ATTRIB_OVERLAPPED)
static size_t const cache_bc::HTTP_ALT_MARSHAL_SIZE = ROUND(sizeof(HTTPCacheAlt), HDR_PTR_SIZE)

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 Cache.cc.


Define Documentation

#define DOCACHE_CLEAR_DYN_STAT (   x  ) 
Value:
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().

#define STORE_COLLISION   1

Definition at line 2357 of file Cache.cc.

#define USELESS_REENABLES

Definition at line 42 of file Cache.cc.


Function Documentation

void build_vol_hash_table ( CacheHostRecord cp  ) 
int64_t cache_bytes_used ( int  volume  ) 
int cache_stats_bytes_used_cb ( const char *  name,
RecDataT  data_type,
RecData data,
RecRawStatBlock rsb,
int  id 
)
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 (  ) 
int cplist_reconfigure (  ) 
void cplist_update (  )  [static]
int create_volume ( int  volume_number,
off_t  size_in_blocks,
int  scheme,
CacheVol cp 
) [static]
static int fillExclusiveDisks ( CacheVol cp  )  [static]
void ink_cache_init ( ModuleVersion  v  ) 
void rebuild_host_table ( Cache cache  )  [static]
static void reg_int ( const char *  str,
int  stat,
RecRawStatBlock rsb,
const char *  prefix,
RecRawStatSyncCb  sync_cb = RecRawStatSyncSum 
) [static]
void register_cache_stats ( RecRawStatBlock rsb,
const char *  prefix 
)
static int update_cache_config ( const char *  ,
RecDataT  ,
RecData  data,
void *   
) [static]

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  ) 
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]
void vol_init_dir ( Vol d  ) 

Variable Documentation

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().

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 72 of file Cache.cc.

Referenced by AIO_Callback_handler::handle_disk_failure(), and ink_cache_init().

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().

Definition at line 66 of file Cache.cc.

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

Definition at line 60 of file Cache.cc.

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

int64_t cache_config_ram_cache_cutoff = AGG_SIZE
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().

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().

Definition at line 67 of file Cache.cc.

Referenced by ink_cache_init().

short int const CACHE_DB_MAJOR_VERSION_COMPATIBLE = 21 [static]

Definition at line 48 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().

Cache* caches[NUM_CACHE_FRAG_TYPES] = { 0 }

Definition at line 208 of file Cache.cc.

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]

Definition at line 584 of file Cache.cc.

size_t DEFAULT_RAM_CACHE_MULTIPLIER = 10 [static]

Definition at line 45 of file Cache.cc.

Referenced by CacheProcessor::cacheInitialized().

Referenced by evacuate_fragments().

CacheDisk** gdisks = NULL

Definition at line 98 of file Cache.cc.

int gndisks = 0
volatile int gnvol = 0
Vol** gvol = NULL

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().

Definition at line 103 of file Cache.cc.

Definition at line 96 of file Cache.cc.