m_Transactional(
false),
79m_LogInMemory(
false),
86m_CheckPointEnable(
true),
89m_DeadLockMode(eDeadLock_Disable),
93 intret = db_env_create(&
m_Env, 0);
100m_Transactional(
false),
102m_LogInMemory(
false),
108m_DirectLOG(
false),
109m_CheckPointEnable(
true),
112m_DeadLockMode(eDeadLock_Disable),
146 intret =
m_Env->set_flags(
m_Env, DB_DSYNC_DB, 1);
147 BDB_CHECK(ret,
"DB_ENV::set_flags(DB_DSYNC_DB)");
155 unsignedcache_g = (unsigned) (cache_size / (
Uint8)1073741824);
157cache_size = cache_size % 1073741824;
159 unsignedncache =
max(num_caches, 1);
161 m_Env->set_cachesize(
m_Env, cache_g, (
unsigned)cache_size, ncache);
162 BDB_CHECK(ret,
"DB_ENV::set_cachesize");
168 BDB_CHECK(ret,
"DB_ENV::set_lg_regionmax");
173 intret =
m_Env->set_lg_bsize(
m_Env, lg_bsize);
174 BDB_CHECK(ret,
"DB_ENV::set_lg_bsize");
188 intrecover_requested =
flags& DB_RECOVER;
191 const char* db_home_param = db_home;
192 if(strlen(db_home) == 0)
193db_home_param =
NULL;
196 if(ret == DB_RUNRECOVERY) {
197 if(
flags& DB_JOINENV) {
200 intrecover_flag =
flags;
202 if(!recover_requested) {
203 if(
flags& DB_INIT_TXN) {
204recover_flag =
flags| DB_RECOVER | DB_CREATE;
212ret =
m_Env->open(
m_Env, db_home_param, recover_flag, 0664);
214 if(!recover_requested) {
217 if((ret == DB_RUNRECOVERY) && (
flags& DB_INIT_TXN)) {
218recover_flag =
flags| DB_RECOVER_FATAL | DB_CREATE;
219recover_flag &= ~DB_RECOVER;
221ret =
m_Env->open(
m_Env, db_home_param, recover_flag, 0664);
224 "Fatal recovery returned error code="<< ret);
235 Open(db_home, DB_CREATE
|DB_THREAD|DB_INIT_LOCK|DB_INIT_MPOOL);
240 intret =
x_Open(db_home.c_str(),
241DB_CREATE|DB_THREAD|DB_PRIVATE|DB_INIT_MPOOL);
242 BDB_CHECK(ret,
"DB_ENV::open_private");
248 intret =
m_Env->set_lk_detect(
m_Env, DB_LOCK_DEFAULT);
249 BDB_CHECK(ret,
"DB_ENV::set_lk_detect");
261 intflag = DB_INIT_TXN |
262DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL;
267 # ifdef NCBI_OS_MSWIN 268flag |= DB_SYSTEM_MEM;
281 intrecover_flag = flag | DB_RECOVER | DB_CREATE;
283 if(!(recover_flag & DB_SYSTEM_MEM)) {
284recover_flag |= DB_PRIVATE;
287ret =
x_Open(db_home.c_str(), recover_flag);
291 if(!(recover_flag & DB_PRIVATE)) {
302ret = db_env_create(&
m_Env, 0);
307 intrecover_flag = flag | DB_RECOVER_FATAL | DB_CREATE;
309 if(!(recover_flag & DB_SYSTEM_MEM)) {
310recover_flag |= DB_PRIVATE;
313ret =
x_Open(db_home.c_str(), recover_flag);
317 if(!(recover_flag & DB_PRIVATE)) {
328ret = db_env_create(&
m_Env, 0);
332 Open(db_home, flag);
338 intret =
m_Env->set_flags(
m_Env, DB_CDB_ALLDB, 1);
339 BDB_CHECK(ret,
"DB_ENV::set_flags(DB_CDB_ALLDB)");
341 Open(db_home, DB_CREATE | DB_THREAD | DB_INIT_CDB | DB_INIT_MPOOL);
348 intflag = DB_JOINENV;
353 Open(db_home, flag);
356 switch(trans_test) {
362 intret =
m_Env->txn_begin(
m_Env, 0, &txn, 0);
366ret = txn->abort(txn);
376 BDB_CHECK(ret,
"DB_ENV::get_open_flags");
377 if(
flags& DB_INIT_TXN) {
426 intret = db_env_create(&
m_Env, 0);
450 intret = db_env_create(&
m_Env, 0);
487 if(log_dir.empty()) {
494 ERR_POST_X(3,
"Cannot create transaction log directory:"<< log_dir);
498 intret =
m_Env->set_lg_dir(
m_Env, log_dir.c_str());
501 catch(exception& ex)
503 ERR_POST_X(4,
"Cannot set transaction log directory:"<< ex.what());
517 intret =
m_Env->set_lg_max(
m_Env, lg_max);
525 intret =
m_Env->set_lk_max_locks(
m_Env, locks);
526 BDB_CHECK(ret,
"DB_ENV::set_lk_max_locks");
534 intret =
m_Env->set_tx_max(
m_Env, tx_max);
558 intret =
m_Env->get_lk_max_locks(
m_Env, &lk_max);
559 BDB_CHECK(ret,
"DB_ENV::get_lk_max_locks");
568 BDB_CHECK(ret,
"DB_ENV::set_lk_max_objects");
576 intret =
m_Env->set_lk_max_lockers(
m_Env, max_lockers);
577 BDB_CHECK(ret,
"DB_ENV::set_lk_max_lockers");
584 #if BDB_FULL_VERSION < 4007000 585 intret =
m_Env->set_flags(
m_Env, DB_LOG_INMEMORY,
int(on_off));
586 BDB_CHECK(ret,
"DB_ENV::set_flags(DB_LOG_INMEMORY)");
588 intret =
m_Env->log_set_config(
m_Env, DB_LOG_IN_MEMORY, (
int)on_off);
589 BDB_CHECK(ret,
"DB_ENV::log_set_config(DB_LOG_IN_MEMORY)");
596 #ifdef BDB_NEW_MUTEX_API 597 intret =
m_Env->mutex_set_tas_spins(
m_Env, tas_spins);
598 BDB_CHECK(ret,
"DB_ENV::mutex_set_tas_spins");
600 intret =
m_Env->set_tas_spins(
m_Env, tas_spins);
601 BDB_CHECK(ret,
"DB_ENV::set_tas_spins");
632 m_Env->set_flags(
m_Env, DB_DIRECT_DB, (
int)on_off);
642 #if BDB_FULL_VERSION < 4007000 643 m_Env->set_flags(
m_Env, DB_DIRECT_LOG, (
int)on_off);
646 m_Env->log_set_config(
m_Env, DB_LOG_DIRECT, (
int)on_off);
654 #if BDB_FULL_VERSION < 4007000 655 intret =
m_Env->set_flags(
m_Env, DB_LOG_AUTOREMOVE, (
int)on_off);
656 BDB_CHECK(ret,
"DB_ENV::set_flags(DB_LOG_AUTOREMOVE)");
658 intret =
m_Env->log_set_config(
m_Env, DB_LOG_AUTO_REMOVE, (
int)on_off);
659 BDB_CHECK(ret,
"DB_ENV::log_set_config(DB_LOG_AUTO_REMOVE)");
669 BDB_CHECK(ret,
"DB_ENV::txn_checkpoint");
677 m_Env->txn_checkpoint(
m_Env, 0, 0, DB_FORCE);
678 BDB_CHECK(ret,
"DB_ENV::txn_checkpoint");
699 m_Env->log_archive(
m_Env, &nm_list, DB_ARCH_ABS);
702 if(nm_list !=
NULL) {
715db_timeout_t to = timeout;
716 intret =
m_Env->set_timeout(
m_Env, to, DB_SET_LOCK_TIMEOUT);
722db_timeout_t to = timeout;
723 intret =
m_Env->set_timeout(
m_Env, to, DB_SET_TXN_TIMEOUT);
729 #ifdef BDB_NEW_MUTEX_API 731 BDB_CHECK(ret,
"DB_ENV::mutex_set_max");
737 #ifdef BDB_NEW_MUTEX_API 739 intret =
m_Env->mutex_get_max(
m_Env, &maxp);
740 BDB_CHECK(ret,
"DB_ENV::mutex_get_max");
749 #ifdef BDB_NEW_MUTEX_API 750 intret =
m_Env->mutex_set_increment(
m_Env, inc);
751 BDB_CHECK(ret,
"DB_ENV::mutex_set_increment");
757 #ifdef BDB_NEW_MUTEX_API 759 intret =
m_Env->mutex_get_increment(
m_Env, &inc);
760 BDB_CHECK(ret,
"DB_ENV::mutex_get_increment");
770 #ifdef BDB_NEW_MUTEX_API 771DB_MUTEX_STAT* stp = 0;
773 intret =
m_Env->mutex_stat(
m_Env, &stp, 0);
775free_m = stp->st_mutex_free;
795 #ifdef BDB_NEW_MUTEX_API 796DB_MUTEX_STAT* stp = 0;
798 intret =
m_Env->mutex_stat(
m_Env, &stp, 0);
801 out<<
"st_mutex_align : "<< stp->st_mutex_align <<
NcbiEndl 802<<
"st_mutex_tas_spins : "<< stp->st_mutex_tas_spins <<
NcbiEndl 803<<
"st_mutex_free : "<< stp->st_mutex_free <<
NcbiEndl 804<<
"st_mutex_inuse : "<< stp->st_mutex_inuse <<
NcbiEndl 805<<
"st_mutex_inuse_max : "<< stp->st_mutex_inuse_max <<
NcbiEndl 806<<
"st_regsize : "<< stp->st_regsize <<
NcbiEndl 807<<
"st_region_wait : "<< stp->st_region_wait <<
NcbiEndl 808<<
"st_region_nowait : "<< stp->st_region_nowait <<
NcbiEndl 827 #ifdef BDB_NEW_MUTEX_API 828DB_LOCK_STAT *stp = 0;
831 intret =
m_Env->lock_stat(
m_Env, &stp, 0);
835<<
"st_cur_maxid : "<< stp->st_cur_maxid <<
NcbiEndl 836<<
"st_nmodes : "<< stp->st_nmodes <<
NcbiEndl 837<<
"st_maxlocks : "<< stp->st_maxlocks <<
NcbiEndl 838<<
"st_maxlockers : "<< stp->st_maxlockers <<
NcbiEndl 839<<
"st_maxobjects : "<< stp->st_maxobjects <<
NcbiEndl 840<<
"st_nlocks : "<< stp->st_nlocks <<
NcbiEndl 841<<
"st_maxnlocks : "<< stp->st_maxnlocks <<
NcbiEndl 842<<
"st_nlockers : "<< stp->st_nlockers <<
NcbiEndl 843<<
"st_maxnlockers : "<< stp->st_maxnlockers <<
NcbiEndl 844<<
"st_nobjects : "<< stp->st_nobjects <<
NcbiEndl 845<<
"st_maxnobjects : "<< stp->st_maxnobjects <<
NcbiEndl 846<<
"st_nrequests : "<< stp->st_nrequests <<
NcbiEndl 847<<
"st_nreleases : "<< stp->st_nreleases <<
NcbiEndl 848<<
"st_nupgrade : "<< stp->st_nupgrade <<
NcbiEndl 849<<
"st_ndowngrade : "<< stp->st_ndowngrade <<
NcbiEndl 850<<
"st_lock_wait : "<< stp->st_lock_wait <<
NcbiEndl 851<<
"st_lock_nowait : "<< stp->st_lock_nowait <<
NcbiEndl 852<<
"st_ndeadlocks : "<< stp->st_ndeadlocks <<
NcbiEndl 853<<
"st_locktimeout : "<< stp->st_locktimeout <<
NcbiEndl 854<<
"st_nlocktimeouts: "<< stp->st_nlocktimeouts <<
NcbiEndl 855<<
"st_txntimeout : "<< stp->st_txntimeout <<
NcbiEndl 856<<
"st_ntxntimeouts : "<< stp->st_ntxntimeouts <<
NcbiEndl 857<<
"st_regsize : "<< stp->st_regsize <<
NcbiEndl 858<<
"st_region_wait : "<< stp->st_region_wait <<
NcbiEndl 859<<
"st_region_nowait: "<< stp->st_region_nowait <<
NcbiEndl 879DB_MPOOL_STAT *stp = 0;
882 intret =
m_Env->memp_stat(
m_Env, &stp, 0, 0);
886 out<<
"st_gbytes : "<< stp->st_gbytes <<
NcbiEndl 887<<
"st_bytes : "<< stp->st_bytes <<
NcbiEndl 888<<
"st_ncache : "<< stp->st_ncache <<
NcbiEndl 889<<
"st_regsize : "<< stp->st_regsize <<
NcbiEndl 890<<
"st_mmapsize : "<< stp->st_mmapsize <<
NcbiEndl 891<<
"st_maxopenfd : "<< stp->st_maxopenfd <<
NcbiEndl 892<<
"st_maxwrite : "<< stp->st_maxwrite <<
NcbiEndl 893<<
"st_maxwrite_sleep : "<< stp->st_maxwrite_sleep <<
NcbiEndl 894<<
"st_map : "<< stp->st_map <<
NcbiEndl 895<<
"st_cache_hit : "<< stp->st_cache_hit <<
NcbiEndl 896<<
"st_cache_miss : "<< stp->st_cache_miss <<
NcbiEndl 897<<
"st_page_create : "<< stp->st_page_create <<
NcbiEndl 898<<
"st_page_in : "<< stp->st_page_in <<
NcbiEndl 899<<
"st_page_out : "<< stp->st_page_out <<
NcbiEndl 900<<
"st_ro_evict : "<< stp->st_ro_evict <<
NcbiEndl 901<<
"st_rw_evict : "<< stp->st_rw_evict <<
NcbiEndl 902<<
"st_page_trickle : "<< stp->st_page_trickle <<
NcbiEndl 903<<
"st_pages : "<< stp->st_pages <<
NcbiEndl 904<<
"st_page_clean : "<< stp->st_page_clean <<
NcbiEndl 905<<
"st_page_dirty : "<< stp->st_page_dirty <<
NcbiEndl 906<<
"st_hash_buckets : "<< stp->st_hash_buckets <<
NcbiEndl 907<<
"st_hash_searches : "<< stp->st_hash_searches <<
NcbiEndl 908<<
"st_hash_longest : "<< stp->st_hash_longest <<
NcbiEndl 909<<
"st_hash_examined : "<< stp->st_hash_examined <<
NcbiEndl 910<<
"st_hash_nowait : "<< stp->st_hash_nowait <<
NcbiEndl 911<<
"st_hash_wait : "<< stp->st_hash_wait <<
NcbiEndl 912 #ifdef BDB_NEW_MEM_STATS 913<<
"st_hash_max_nowait : "<< stp->st_hash_max_nowait <<
NcbiEndl 915<<
"st_hash_max_wait : "<< stp->st_hash_max_wait <<
NcbiEndl 916<<
"st_region_wait : "<< stp->st_region_wait <<
NcbiEndl 917<<
"st_region_nowait : "<< stp->st_region_nowait <<
NcbiEndl 918 #ifdef BDB_NEW_MEM_STATS 919<<
"st_mvcc_frozen : "<< stp->st_mvcc_frozen <<
NcbiEndl 920<<
"st_mvcc_thawed : "<< stp->st_mvcc_thawed <<
NcbiEndl 921<<
"st_mvcc_freed : "<< stp->st_mvcc_freed <<
NcbiEndl 923<<
"st_alloc : "<< stp->st_alloc <<
NcbiEndl 924<<
"st_alloc_buckets : "<< stp->st_alloc_buckets <<
NcbiEndl 925<<
"st_alloc_max_buckets: "<< stp->st_alloc_max_buckets <<
NcbiEndl 926<<
"st_alloc_pages : "<< stp->st_alloc_pages <<
NcbiEndl 927<<
"st_alloc_max_pages : "<< stp->st_alloc_max_pages <<
NcbiEndl 928 #ifdef BDB_NEW_MEM_STATS 929<<
"st_io_wait : "<< stp->st_io_wait <<
NcbiEndl 934 #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 6) || DB_VERSION_MAJOR > 4 935db_timeout_t max_write_sleep;
940 m_Env->get_mp_max_write(
m_Env, &max_write, &max_write_sleep);
941 BDB_CHECK(ret,
"DB_ENV::get_mp_max_write");
943 out<<
"max_write (pages) : "<< max_write <<
NcbiEndl 944<<
"max_write_sleep (microsec) : "<< max_write_sleep <<
NcbiEndl 965 intret =
m_Env->memp_trickle(
m_Env, percent, &nwr);
966 BDB_CHECK(ret,
"DB_ENV::memp_trickle");
971 string msg=
"BDB_ENV: memp_tricle ";
973 msg+=
"% written ";
989 intret =
m_Env->set_mp_max_write(
m_Env, maxwrite, maxwrite_sleep);
990 BDB_CHECK(ret,
"DB_ENV::set_mp_max_write");
997 intret =
m_Env->get_mp_mmapsize(
m_Env, &map_size);
998 BDB_CHECK(ret,
"DB_ENV::get_mp_mmapsize");
1005 intret =
m_Env->set_mp_mmapsize(
m_Env, map_size);
1006 BDB_CHECK(ret,
"DB_ENV::set_mp_mmapsize");
1011u_int32_t detect = 0;
1012 switch(detect_mode)
1017detect = DB_LOCK_DEFAULT;
1020detect = DB_LOCK_MAXLOCKS;
1023detect = DB_LOCK_MINWRITE;
1026detect = DB_LOCK_OLDEST;
1029detect = DB_LOCK_RANDOM;
1032detect = DB_LOCK_YOUNGEST;
1048 intret =
m_Env->set_lk_detect(
m_Env, detect);
1049 BDB_CHECK(ret,
"DB_ENV::set_lk_detect");
1059 intret =
m_Env->lock_detect(
m_Env, 0, detect, &aborted);
1095 unsignedthread_delay,
1099 # ifdef NCBI_THREADS 1100 LOG_POST_X(6,
Info<<
"Starting BDB transaction checkpoint thread.");
1110 "Cannot run BDB transaction checkpoint thread in non-MT configuration.");
1128 # ifdef NCBI_THREADS 1130 LOG_POST_X(8,
Info<<
"Stopping BDB transaction checkpoint thread...");
1135 LOG_POST_X(9,
Info<<
"BDB transaction checkpoint thread stopped.");
1150 if((ret = db_env_create(&dbenv, 0)) != 0) {
1152 "Cannot create environment "+
string(db_strerror(ret));
1156dbenv->set_errfile(dbenv, stderr);
1160u_int32_t
flags= 0;
1161 flags|= DB_CREATE | DB_INIT_LOG |
1162DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON;
1163 flags|= fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER;
1164 flags|= DB_PRIVATE;
1166 if((ret = dbenv->open(dbenv, path.c_str(),
flags, 0)) != 0) {
1167dbenv->close(dbenv, 0);
1169 "Cannot open environment "+
string(db_strerror(ret));
1172ret = dbenv->close(dbenv, 0);
Wrapper around Berkeley DB environment structure.
Wrapper around Berkeley DB transaction structure.
Transaction checkpoint / memptrickle thread.
static void AddOnExitCallback(CBDB_Env &bdb_env)
shared_ptr< bool > m_StopThreadFlag
void operator()(void) const
CBDB_Env_OnAppExit(CBDB_Env &bdb_env)
BDB environment object a collection including support for some or all of caching, locking,...
Base BDB exception class.
void RequestStop()
Schedule thread Stop.
std::ofstream out("events_result.xml")
main entry point for tests
void AddOnExitAction(TFunc func)
Add callback to be executed from CNcbiApplicationAPI destructor.
static CNcbiApplicationGuard InstanceGuard(void)
Singleton method.
ETransSync
Enum controls if transaction is synchronous or not.
void StopCheckpointThread()
Stop transaction checkpoint thread.
void SetTransactionMax(unsigned tx_max)
Set number of active transaction see DB_ENV->set_tx_max for more details.
void SetDirectDB(bool on_off)
Turn off buffering of databases (DB_DIRECT_DB)
void PrintMemStat(CNcbiOstream &out)
Print memory statistics.
void BDB_RecoverEnv(const string &path, bool fatal_recover)
Run Berkeley DB recovery in private environment.
void SetCacheSize(Uint8 cache_size, int num_caches=1)
Set cache size for the environment.
bool m_Transactional
TRUE if transactional.
unsigned x_GetDeadLockDetect(EDeadLockDetect detect_mode)
void MutexSetMax(unsigned max)
Configure the total number of mutexes.
void CleanLog()
Remove all non-active log files.
ETransactionDiscovery
Modes to test if environment is transactional or not.
unsigned MutexGetFree()
Get number of free mutexes.
void SetDirectLog(bool on_off)
Turn off buffering of log files (DB_DIRECT_LOG)
void SetMpMaxWrite(int maxwrite, int maxwrite_sleep)
limits the number of sequential write operations scheduled by the library when flushing dirty pages f...
void LogFlush()
Flush all pending log records.
bool CheckRemove()
Try to Remove the environment, if DB_ENV::remove returns 0, but fails files ramain on disk anyway cal...
void SetLockTimeout(unsigned timeout)
Set timeout value for locks in microseconds (1 000 000 in sec)
size_t GetMpMmapSize()
Get the maximal size for mmap.
void SetTasSpins(unsigned tas_spins)
Specify that test-and-set mutexes should spin tas_spins times without blocking.
void SetLogInMemory(bool on_off)
Configure environment for non-durable in-memory logging.
void TransactionCheckpoint()
Flush the underlying memory pools, logs and data bases.
void SetMaxLocks(unsigned locks)
Set max number of locks in the database.
void StopBackgroundWriterThread()
Stop transaction checkpoint thread.
void SetLogRegionMax(unsigned size)
Set logging region size.
void SetLogAutoRemove(bool on_off)
If set, Berkeley DB will automatically remove log files that are no longer needed.
shared_ptr< bool > m_StopThreadFlag
void SetLkDetect(EDeadLockDetect detect_mode)
Set deadlock detect mode (call before open).
IServer_Monitor * m_Monitor
Monitoring interface.
void SetLogDir(const string &log_dir)
Path to directory where transaction logs are to be stored By default it is the same directory as envi...
EDeadLockDetect m_DeadLockMode
void SetLogFileMax(unsigned int lg_max)
Set maximum size of LOG files.
void LsnReset(const char *file_name)
Reset log sequence number.
void RunBackgroundWriter(TBackgroundFlags flags, unsigned thread_delay=30, int memp_trickle=0, unsigned err_max=0)
Schedule background maintenance thread which will do:
void SetTransactionTimeout(unsigned timeout)
Set timeout value for transactions in microseconds (1 000 000 in sec)
void LsnResetForMemLog(const char *file_name)
Reset log sequence number if environment logs are in memory.
unsigned m_CheckPointKB
Checkpoint KBytes.
void OpenPrivate(const string &db_home)
Open-create private environment.
#define BDB_THROW(errcode, message)
void SetWorkFlag(CBDB_Env::TBackgroundFlags flags)
unsigned MutexGetMax()
Get number of mutexes.
void DeadLockDetect()
Run deadlock detector.
unsigned int TEnvOpenFlags
OR-ed combination of EEnvOptions.
void MempSync()
Flushes modified pages in the cache to their backing files.
void MutexSetIncrement(unsigned inc)
Configure the number of additional mutexes to allocate.
void SetMaxLockObjects(unsigned lock_obj_max)
see DB_ENV->set_lk_max_objects for more details
unsigned m_MaxLockObjects
unsigned TBackgroundFlags
Background work flags (combination of EBackgroundWork)
void SetMaxLockers(unsigned max_lockers)
Set the maximum number of locking entities supported by the Berkeley DB environment.
CBDB_Transaction::ETransSync m_TransSync
void OpenWithLocks(const string &db_home)
Open environment with database locking (DB_INIT_LOCK)
void SetTransactionSync(CBDB_Transaction::ETransSync sync)
Set default syncronicity level.
void MempTrickle(int percent, int *nwrotep)
Ensures that a specified percent of the pages in the shared memory pool are clean,...
int x_Open(const char *db_home, int flags)
Opens BDB environment returns error code Throws no exceptions.
void Close()
Close the environment;.
DB_TXN * CreateTxn(DB_TXN *parent_txn=0, unsigned int flags=0)
Start transaction (DB_ENV->txn_begin)
unsigned MutexGetIncrement()
void SetMaxErrors(unsigned max_err)
Set maximum number of errors this thread tolerates 0 - unlimited.
CRef< CBDB_CheckPointThread > m_CheckThread
Checkpoint thread.
void OpenConcurrentDB(const string &db_home)
Open environment with CDB locking (DB_INIT_CDB)
bool Remove()
Non-force removal of BDB environment.
void ForceRemove()
Force remove BDB environment.
void OpenErrFile(const string &file_name)
Open error reporting file for the environment.
bool m_CheckPointEnable
Checkpoint enabled.
unsigned GetMaxLocks()
Get max locks.
void PrintMutexStat(CNcbiOstream &out)
Print mutex statistics.
EDeadLockDetect
Deadlock detection modes.
unsigned m_CheckPointMin
Checkpoint minutes.
void Open(const string &db_home, int flags)
Open environment.
void SetMpMmapSize(size_t map_size)
Set the maximal size for mmap.
void OpenWithTrans(const string &db_home, TEnvOpenFlags opt=0)
Open environment using transaction.
bool IsTransactional() const
Return TRUE if environment has been open as transactional.
#define BDB_CHECK(errnum, x_db_object__)
void ForceTransactionCheckpoint()
Forced checkpoint.
void SetErrPrefix(const string &s)
Set the prefix used during reporting of errors.
void SetLogBSize(unsigned lg_bsize)
Set the size of the in-memory log buffer, in bytes.
void RunCheckpointThread(unsigned thread_delay=30, int memp_trickle=0, unsigned err_max=0)
Deprecated version of RunBackgroundWriter.
void PrintLockStat(CNcbiOstream &out)
Print lock statistics.
void JoinEnv(const string &db_home, TEnvOpenFlags opt=0, ETransactionDiscovery trans_test=eTestTransactions)
Join the existing environment.
@ eEnvDefault
Use default from CBDB_Env.
@ eTransSync
Syncronous transaction.
@ eTestTransactions
Do a test to discover transactions.
@ eInspectTransactions
Ask the joined environment if it supports transactions.
@ eAssumeNoTransactions
Assume env. is non-transactional.
@ eAssumeTransactions
Assume env. is transactional.
@ eBackground_DeadLockDetect
@ eBackground_MempTrickle
@ eRunRecovery
Run DB recovery first.
@ ePrivate
Create private directory.
@ eThreaded
corresponds to DB_THREAD
@ eRunRecoveryFatal
Run DB recovery first.
@ eDeadLock_Youngest
Abort the youngest trans.
@ eDeadLock_MaxLocks
Abort trans with the greatest number of locks.
@ eDeadLock_MinWrite
Abort trans with the fewest write locks.
@ eDeadLock_Oldest
Abort the oldest trans.
@ eDeadLock_Default
Default deadlock detector.
@ eDeadLock_Disable
No deadlock detection performed.
@ eDeadLock_Random
Abort a random trans involved in the deadlock.
#define LOG_POST_X(err_subcode, message)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
void Warning(CExceptionArgs_Base &args)
void Info(CExceptionArgs_Base &args)
TEntries GetEntries(const string &mask=kEmptyStr, TGetEntriesFlags flags=0) const
Get directory entries based on the specified "mask".
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
virtual bool Exists(void) const
Check if directory "dirname" exists.
bool Create(TCreateFlags flags=fCreate_Default) const
Create the directory using "dirname" passed in the constructor.
void Reset(void)
Reset reference object.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
uint32_t Uint4
4-byte (32-bit) unsigned integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
virtual bool IsActive()=0
Check if monitoring is active.
virtual void Send(const char *msg, size_t length)=0
Send message.
bool Run(TRunMode flags=fRunDefault)
Run the thread.
void Join(void **exit_data=0)
Wait for the thread termination.
Definition of all error codes used in bdb library (bdb.lib and ncbi_xcache_bdb.lib).
const struct ncbi::grid::netcache::search::fields::SIZE size
Common macro to detect used sanitizers and suppress memory leaks if run under LeakSanitizer.
#define NCBI_LSAN_DISABLE_GUARD
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4