NCBI C++ ToolKit
Macros | Functions | Variables
bdb_util.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbifile.hpp>
#include <db/bdb/bdb_util.hpp>
#include <db/bdb/bdb_env.hpp>
#include <db/error_codes.hpp>
#include <util/strsearch.hpp>
+ Include dependency graph for bdb_util.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Db_Bdb_Util
 

Functions

static const char * BDB_GetStringFieldBuf (const CBDB_Field &fld)
 Check if field is a variant of string, returns pointer on the internal buffer (or NULL). More...
 
static int BDB_find_field (const CBDB_BufferManager &buffer_man, const CBoyerMooreMatcher &matcher, string *tmp_str)
 Search for value in the field buffer. More...
 
CBDB_File::TUnifiedFieldIndex BDB_find_field (const CBDB_File &dbf, const CBoyerMooreMatcher &matcher, string *tmp_str)
 Find index of field containing the specified value Search condition is specified by CBoyerMooreMatcher By default search is performed in string fields, but if tmp_str_buffer is specified function will try to convert non-strings(int, float) and search in there. More...
 
int BDB_get_rowid (const CBDB_File &dbf)
 Return record id (integer key) More...
 
template<typename T >
void s_LogEnvParam (const string &param_name, const T &param_value, const string &units=kEmptyStr)
 Log a parameter in a human-readable format. More...
 
static void s_LogEnvParam (const string &param_name, const bool &param_value)
 Log a parameter in a human-readable format. More...
 
CBDB_EnvBDB_CreateEnv (const CNcbiRegistry &reg, const string &section_name)
 Create and configure BDB environment using CNcbiRegistry as a parameter container. More...
 

Variables

static const char * kEnvParam_type = "env_type"
 
static const char * kEnvParam_path = "path"
 
static const char * kEnvParam_reinit = "reinit"
 
static const char * kEnvParam_errfile = "error_file"
 
static const char * kEnvParam_mem_size = "mem_size"
 
static const char * kEnvParam_cache_size = "cache_size"
 
static const char * kEnvParam_cache_num = "cache_num"
 
static const char * kEnvParam_log_mem_size = "log_mem_size"
 
static const char * kEnvParam_write_sync = "write_sync"
 
static const char * kEnvParam_direct_db = "direct_db"
 
static const char * kEnvParam_direct_log = "direct_log"
 
static const char * kEnvParam_transaction_log_path = "transaction_log_path"
 
static const char * kEnvParam_log_file_max = "log_file_max"
 
static const char * kEnvParam_log_autoremove = "log_autoremove"
 
static const char * kEnvParam_lock_timeout = "lock_timeout"
 
static const char * kEnvParam_TAS_spins = "tas_spins"
 
static const char * kEnvParam_max_locks = "max_locks"
 
static const char * kEnvParam_max_lock_objects = "max_lock_objects"
 
static const char * kEnvParam_mp_maxwrite = "mp_maxwrite"
 
static const char * kEnvParam_mp_maxwrite_sleep = "mp_maxwrite_sleep"
 
static const char * kEnvParam_checkpoint_interval = "checkpoint_interval"
 
static const char * kEnvParam_enable_checkpoint = "enable_checkpoint"
 
static const char * kEnvParam_checkpoint_kb = "checkpoint_kb"
 
static const char * kEnvParam_checkpoint_min = "checkpoint_min"
 
static const char * kEnvParam_memp_trickle_percent = "memp_trickle_percent"
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Db_Bdb_Util

Definition at line 40 of file bdb_util.cpp.

Function Documentation

◆ BDB_find_field()

static int BDB_find_field ( const CBDB_BufferManager buffer_man,
const CBoyerMooreMatcher matcher,
string tmp_str 
)
static

Search for value in the field buffer.

Returns
-1 if not found, otherwise field number

Definition at line 72 of file bdb_util.cpp.

References BDB_GetStringFieldBuf(), CBDB_BufferManager::FieldCount(), IBDB_Field::GetDataLength(), CBDB_BufferManager::GetField(), i, CBDB_Field::IsNull(), match(), NPOS, CBoyerMooreMatcher::Search(), and IBDB_FieldConvert::ToString().

Referenced by BDB_find_field().

◆ BDB_GetStringFieldBuf()

static const char* BDB_GetStringFieldBuf ( const CBDB_Field fld)
static

Check if field is a variant of string, returns pointer on the internal buffer (or NULL).

Definition at line 50 of file bdb_util.cpp.

References CBDB_Field::GetBuffer().

Referenced by BDB_find_field().

◆ s_LogEnvParam() [1/2]

static void s_LogEnvParam ( const string param_name,
const bool param_value 
)
static

Log a parameter in a human-readable format.

Definition at line 196 of file bdb_util.cpp.

References Info(), and LOG_POST_X.

◆ s_LogEnvParam() [2/2]

template<typename T >
void s_LogEnvParam ( const string param_name,
const T param_value,
const string units = kEmptyStr 
)

Log a parameter in a human-readable format.

Definition at line 182 of file bdb_util.cpp.

References Info(), and LOG_POST_X.

Referenced by BDB_CreateEnv().

Variable Documentation

◆ kEnvParam_cache_num

const char* kEnvParam_cache_num = "cache_num"
static

Definition at line 214 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_cache_size

const char* kEnvParam_cache_size = "cache_size"
static

Definition at line 213 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_checkpoint_interval

const char* kEnvParam_checkpoint_interval = "checkpoint_interval"
static

Definition at line 229 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_checkpoint_kb

const char* kEnvParam_checkpoint_kb = "checkpoint_kb"
static

Definition at line 231 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_checkpoint_min

const char* kEnvParam_checkpoint_min = "checkpoint_min"
static

Definition at line 232 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_direct_db

const char* kEnvParam_direct_db = "direct_db"
static

Definition at line 217 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_direct_log

const char* kEnvParam_direct_log = "direct_log"
static

Definition at line 218 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_enable_checkpoint

const char* kEnvParam_enable_checkpoint = "enable_checkpoint"
static

Definition at line 230 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_errfile

const char* kEnvParam_errfile = "error_file"
static

Definition at line 210 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_lock_timeout

const char* kEnvParam_lock_timeout = "lock_timeout"
static

Definition at line 222 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_log_autoremove

const char* kEnvParam_log_autoremove = "log_autoremove"
static

Definition at line 221 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_log_file_max

const char* kEnvParam_log_file_max = "log_file_max"
static

Definition at line 220 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_log_mem_size

const char* kEnvParam_log_mem_size = "log_mem_size"
static

Definition at line 215 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_max_lock_objects

const char* kEnvParam_max_lock_objects = "max_lock_objects"
static

Definition at line 225 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_max_locks

const char* kEnvParam_max_locks = "max_locks"
static

Definition at line 224 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_mem_size

const char* kEnvParam_mem_size = "mem_size"
static

Definition at line 212 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_memp_trickle_percent

const char* kEnvParam_memp_trickle_percent = "memp_trickle_percent"
static

Definition at line 233 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_mp_maxwrite

const char* kEnvParam_mp_maxwrite = "mp_maxwrite"
static

Definition at line 226 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_mp_maxwrite_sleep

const char* kEnvParam_mp_maxwrite_sleep = "mp_maxwrite_sleep"
static

Definition at line 227 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_path

const char* kEnvParam_path = "path"
static

Definition at line 208 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_reinit

const char* kEnvParam_reinit = "reinit"
static

Definition at line 209 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_TAS_spins

const char* kEnvParam_TAS_spins = "tas_spins"
static

Definition at line 223 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_transaction_log_path

const char* kEnvParam_transaction_log_path = "transaction_log_path"
static

Definition at line 219 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_type

const char* kEnvParam_type = "env_type"
static

Definition at line 207 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

◆ kEnvParam_write_sync

const char* kEnvParam_write_sync = "write_sync"
static

Definition at line 216 of file bdb_util.cpp.

Referenced by BDB_CreateEnv().

Modified on Sat May 25 14:18:28 2024 by modify_doxy.py rev. 669887