NCBI C++ ToolKit
Classes | Macros | Functions | Variables
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 <corelib/ncbiexpt.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.

Go to the SVN repository for 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  CBDB_Cache_OnAppExit
 
class  CPurgeFlagGuard
 
class  CBDB_CacheReaderCF
 Class factory for BDB implementation of ICache. More...
 

Macros

#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. More...
 
void BDB_Register_Cache (void)
 Register NCBI_BDB_ICacheEntryPoint. More...
 
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. More...
 

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"
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Db_Bdb_BlobCache

Definition at line 63 of file bdb_blobcache.cpp.

Function Documentation

◆ s_GetDayHour()

static void s_GetDayHour ( time_t  time_in_secs,
unsigned *  day,
unsigned *  hour 
)
static

Compute current hour of day.

Definition at line 662 of file bdb_blobcache.cpp.

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

◆ s_MakeOverflowFileName()

static void s_MakeOverflowFileName ( string buf,
const string path,
const string cache,
const string key,
int  version,
const string subkey 
)
static

Variable Documentation

◆ kBDBCacheStartedFileName

const char* kBDBCacheStartedFileName = "__ncbi_cache_started__"

Definition at line 80 of file bdb_blobcache.cpp.

Referenced by CBDB_Cache::Close(), and CBDB_Cache::Open().

◆ kCFParam_checkpoint_bytes

const char* kCFParam_checkpoint_bytes = "checkpoint_bytes"
static

Definition at line 5209 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_checkpoint_delay

const char* kCFParam_checkpoint_delay = "checkpoint_delay"
static

Definition at line 5208 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_direct_db

const char* kCFParam_direct_db = "direct_db"
static

Definition at line 5199 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_direct_log

const char* kCFParam_direct_log = "direct_log"
static

Definition at line 5200 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_drop_if_dirty

const char* kCFParam_drop_if_dirty = "drop_if_dirty"
static

Definition at line 5188 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_lock

const char* kCFParam_lock = "lock"
static

Definition at line 5190 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_lock_default

const char* kCFParam_lock_default = "no_lock"
static

Definition at line 5191 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_lock_pid_lock

const char* kCFParam_lock_pid_lock = "pid_lock"
static

Definition at line 5192 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_log_file_max

const char* kCFParam_log_file_max = "log_file_max"
static

Definition at line 5210 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_log_mem_size

const char* kCFParam_log_mem_size = "log_mem_size"
static

Definition at line 5195 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_max_blob_size

const char* kCFParam_max_blob_size = "max_blob_size"
static

Definition at line 5213 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_mem_size

const char* kCFParam_mem_size = "mem_size"
static

Definition at line 5194 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_memp_trickle

const char* kCFParam_memp_trickle = "memp_trickle"
static

Definition at line 5215 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_name

const char* kCFParam_name = "name"
static

◆ kCFParam_overflow_limit

const char* kCFParam_overflow_limit = "overflow_limit"
static

Definition at line 5211 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_path

const char* kCFParam_path = "path"
static

◆ kCFParam_purge_batch_size

const char* kCFParam_purge_batch_size = "purge_batch_size"
static

Definition at line 5203 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_purge_batch_sleep

const char* kCFParam_purge_batch_sleep = "purge_batch_sleep"
static

Definition at line 5204 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_purge_clean_log

const char* kCFParam_purge_clean_log = "purge_clean_log"
static

Definition at line 5205 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_purge_thread

const char* kCFParam_purge_thread = "purge_thread"
static

Definition at line 5206 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_purge_thread_delay

const char* kCFParam_purge_thread_delay = "purge_thread_delay"
static

Definition at line 5207 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_read_only

const char* kCFParam_read_only = "read_only"
static

Definition at line 5196 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_rr_volumes

const char* kCFParam_rr_volumes = "rr_volumes"
static

Definition at line 5214 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_TAS_spins

const char* kCFParam_TAS_spins = "tas_spins"
static

Definition at line 5216 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_transaction_log_path

const char* kCFParam_transaction_log_path = "transaction_log_path"
static

Definition at line 5201 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_ttl_prolong

const char* kCFParam_ttl_prolong = "ttl_prolong"
static

Definition at line 5212 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_use_transactions

const char* kCFParam_use_transactions = "use_transactions"
static

Definition at line 5198 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

◆ kCFParam_write_sync

const char* kCFParam_write_sync = "write_sync"
static

Definition at line 5197 of file bdb_blobcache.cpp.

Referenced by CBDB_CacheReaderCF::x_CreateInstance().

Modified on Thu Jun 13 17:28:21 2024 by modify_doxy.py rev. 669887