src/db/bdb/bdb_blobcache.cpp File Reference

#include <ncbi_pch.hpp>
#include <corelib/ncbitime.hpp>
#include <corelib/ncbifile.hpp>
#include <corelib/ncbi_process.hpp>
#include <corelib/plugin_manager_impl.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/ncbi_limits.h>
#include <corelib/ncbimtx.hpp>
#include <corelib/plugin_manager_store.hpp>
#include <connect/server_monitor.hpp>
#include <db.h>
#include <db/bdb/bdb_blobcache.hpp>
#include <db/bdb/bdb_cursor.hpp>
#include <db/bdb/bdb_trans.hpp>
#include <db/error_codes.hpp>
#include <util/cache/icache_cf.hpp>
#include <util/cache/icache_clean_thread.hpp>
#include <util/simple_buffer.hpp>
#include <time.h>
#include <math.h>

Include dependency graph for bdb_blobcache.cpp:

Go to the source code of this file.

Classes

struct  SCacheDescr
class  CBDB_CacheIReader
class  CCacheBufferResizeStrategy
 Buffer resize strategy, to balance memory reallocs and heap consumption. More...
class  CBDB_CacheIWriter
class  CPurgeFlagGuard
class  CBDB_CacheReaderCF
 Class factory for BDB implementation of ICache. More...

Defines

#define NCBI_USE_ERRCODE_X   Db_Bdb_BlobCache

Functions

static void s_MakeOverflowFileName (string &buf, const string &path, const string &cache, const string &key, int version, const string &subkey)
static void s_GetDayHour (time_t time_in_secs, unsigned *day, unsigned *hour)
 Compute current hour of day.
void BDB_Register_Cache (void)
 Register NCBI_BDB_ICacheEntryPoint.
void NCBI_BDB_ICacheEntryPoint (CPluginManager< ICache >::TDriverInfoList &info_list, CPluginManager< ICache >::EEntryPointRequest method)
void NCBI_EntryPoint_xcache_bdb (CPluginManager< ICache >::TDriverInfoList &info_list, CPluginManager< ICache >::EEntryPointRequest method)
void BDB_ConfigureCache (CBDB_Cache &bdb_cache, const string &path, const string &name, unsigned timeout, ICache::TTimeStampFlags tflags)
 Utility for simple cache configuration.

Variables

const char * kBDBCacheStartedFileName = "__ncbi_cache_started__"
const char * kBDBCacheDriverName = "bdb"
static const char * kCFParam_path = "path"
static const char * kCFParam_name = "name"
static const char * kCFParam_drop_if_dirty = "drop_if_dirty"
static const char * kCFParam_lock = "lock"
static const char * kCFParam_lock_default = "no_lock"
static const char * kCFParam_lock_pid_lock = "pid_lock"
static const char * kCFParam_mem_size = "mem_size"
static const char * kCFParam_log_mem_size = "log_mem_size"
static const char * kCFParam_read_only = "read_only"
static const char * kCFParam_write_sync = "write_sync"
static const char * kCFParam_use_transactions = "use_transactions"
static const char * kCFParam_direct_db = "direct_db"
static const char * kCFParam_direct_log = "direct_log"
static const char * kCFParam_transaction_log_path = "transaction_log_path"
static const char * kCFParam_purge_batch_size = "purge_batch_size"
static const char * kCFParam_purge_batch_sleep = "purge_batch_sleep"
static const char * kCFParam_purge_clean_log = "purge_clean_log"
static const char * kCFParam_purge_thread = "purge_thread"
static const char * kCFParam_purge_thread_delay = "purge_thread_delay"
static const char * kCFParam_checkpoint_delay = "checkpoint_delay"
static const char * kCFParam_checkpoint_bytes = "checkpoint_bytes"
static const char * kCFParam_log_file_max = "log_file_max"
static const char * kCFParam_overflow_limit = "overflow_limit"
static const char * kCFParam_ttl_prolong = "ttl_prolong"
static const char * kCFParam_max_blob_size = "max_blob_size"
static const char * kCFParam_rr_volumes = "rr_volumes"
static const char * kCFParam_memp_trickle = "memp_trickle"
static const char * kCFParam_TAS_spins = "tas_spins"


Define Documentation

#define NCBI_USE_ERRCODE_X   Db_Bdb_BlobCache
 

Definition at line 62 of file bdb_blobcache.cpp.


Function Documentation

static void s_GetDayHour time_t  time_in_secs,
unsigned *  day,
unsigned *  hour
[static]
 

Compute current hour of day.

Definition at line 661 of file bdb_blobcache.cpp.

Referenced by SBDB_CacheUnitStatistics::AddRead(), and SBDB_CacheUnitStatistics::AddStore().

static void s_MakeOverflowFileName string &  buf,
const string &  path,
const string &  cache,
const string &  key,
int  version,
const string &  subkey
[static]
 

Definition at line 82 of file bdb_blobcache.cpp.

References NStr::IntToString().

Referenced by CBDB_Cache::GetSizeEx(), CBDB_CacheIWriter::OpenOverflowFile(), CBDB_Cache::Read(), CBDB_Cache::x_CreateOverflowReader(), CBDB_Cache::x_DropOverflow(), and CBDB_Cache::x_Store().


Variable Documentation

const char* kBDBCacheStartedFileName = "__ncbi_cache_started__"
 

Definition at line 79 of file bdb_blobcache.cpp.

Referenced by CBDB_Cache::Open().

const char* kCFParam_checkpoint_bytes = "checkpoint_bytes" [static]
 

Definition at line 5136 of file bdb_blobcache.cpp.

const char* kCFParam_checkpoint_delay = "checkpoint_delay" [static]
 

Definition at line 5135 of file bdb_blobcache.cpp.

const char* kCFParam_direct_db = "direct_db" [static]
 

Definition at line 5126 of file bdb_blobcache.cpp.

const char* kCFParam_direct_log = "direct_log" [static]
 

Definition at line 5127 of file bdb_blobcache.cpp.

const char* kCFParam_drop_if_dirty = "drop_if_dirty" [static]
 

Definition at line 5115 of file bdb_blobcache.cpp.

const char* kCFParam_lock = "lock" [static]
 

Definition at line 5117 of file bdb_blobcache.cpp.

const char* kCFParam_lock_default = "no_lock" [static]
 

Definition at line 5118 of file bdb_blobcache.cpp.

const char* kCFParam_lock_pid_lock = "pid_lock" [static]
 

Definition at line 5119 of file bdb_blobcache.cpp.

const char* kCFParam_log_file_max = "log_file_max" [static]
 

Definition at line 5137 of file bdb_blobcache.cpp.

const char* kCFParam_log_mem_size = "log_mem_size" [static]
 

Definition at line 5122 of file bdb_blobcache.cpp.

const char* kCFParam_max_blob_size = "max_blob_size" [static]
 

Definition at line 5140 of file bdb_blobcache.cpp.

const char* kCFParam_mem_size = "mem_size" [static]
 

Definition at line 5121 of file bdb_blobcache.cpp.

const char* kCFParam_memp_trickle = "memp_trickle" [static]
 

Definition at line 5142 of file bdb_blobcache.cpp.

const char* kCFParam_name = "name" [static]
 

Definition at line 5114 of file bdb_blobcache.cpp.

const char* kCFParam_overflow_limit = "overflow_limit" [static]
 

Definition at line 5138 of file bdb_blobcache.cpp.

const char* kCFParam_path = "path" [static]
 

Definition at line 5113 of file bdb_blobcache.cpp.

const char* kCFParam_purge_batch_size = "purge_batch_size" [static]
 

Definition at line 5130 of file bdb_blobcache.cpp.

const char* kCFParam_purge_batch_sleep = "purge_batch_sleep" [static]
 

Definition at line 5131 of file bdb_blobcache.cpp.

const char* kCFParam_purge_clean_log = "purge_clean_log" [static]
 

Definition at line 5132 of file bdb_blobcache.cpp.

const char* kCFParam_purge_thread = "purge_thread" [static]
 

Definition at line 5133 of file bdb_blobcache.cpp.

const char* kCFParam_purge_thread_delay = "purge_thread_delay" [static]
 

Definition at line 5134 of file bdb_blobcache.cpp.

const char* kCFParam_read_only = "read_only" [static]
 

Definition at line 5123 of file bdb_blobcache.cpp.

const char* kCFParam_rr_volumes = "rr_volumes" [static]
 

Definition at line 5141 of file bdb_blobcache.cpp.

const char* kCFParam_TAS_spins = "tas_spins" [static]
 

Definition at line 5143 of file bdb_blobcache.cpp.

const char* kCFParam_transaction_log_path = "transaction_log_path" [static]
 

Definition at line 5128 of file bdb_blobcache.cpp.

const char* kCFParam_ttl_prolong = "ttl_prolong" [static]
 

Definition at line 5139 of file bdb_blobcache.cpp.

const char* kCFParam_use_transactions = "use_transactions" [static]
 

Definition at line 5125 of file bdb_blobcache.cpp.

const char* kCFParam_write_sync = "write_sync" [static]
 

Definition at line 5124 of file bdb_blobcache.cpp.


Generated on Mon Dec 7 07:37:16 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:21:45 2009 by modify_doxy.py rev. 173732