BDB library utilities
[BDB]

Collaboration diagram for BDB library utilities:


Functions

template<class FL, class Func>
void BDB_iterate_file (FL &dbf, Func &func)
 Template algorithm function to iterate the BDB File.
template<class FL, class IT, class Func>
void BDB_iterate_file (FL &dbf, IT start, IT finish, Func &func)
 Iterate file following the sequence of ids BDB file should have an integer key.
template<class IT, class Lock>
void BDB_batch_delete_recs (CBDB_File &dbf, IT start, IT finish, unsigned batch_size, Lock *locker)
 Delete file records based on sequence of ids.
CBDB_File::TUnifiedFieldIndex BDB_find_field (const CBDB_File &dbf, const CBoyerMooreMatcher &matcher, string *tmp_str_buffer=0)
 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.
int BDB_get_rowid (const CBDB_File &dbf)
 Return record id (integer key).


Function Documentation

template<class IT, class Lock>
void BDB_batch_delete_recs CBDB_File dbf,
IT  start,
IT  finish,
unsigned  batch_size,
Lock *  locker
 

Delete file records based on sequence of ids.

Records are getting deleted in batches (one transaction per batch) We need batches not to overflow transaction log and not to lock the file for a long time (to allow concurrent access)

Definition at line 89 of file bdb_util.hpp.

References _ASSERT, CBDB_File::Delete(), CBDB_RawFile::eIgnoreError, CBDB_Transaction::eTransASync, CBDB_BufferManager::FieldCount(), CBDB_RawFile::GetEnv(), CBDB_BufferManager::GetField(), CBDB_File::GetKeyBuffer(), ITERATE, and CBDB_RawFile::SetTransaction().

CBDB_File::TUnifiedFieldIndex BDB_find_field const CBDB_File dbf,
const CBoyerMooreMatcher matcher,
string *  tmp_str_buffer = 0
 

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.

Parameters:
dbf Database to search in. Should be positioned on some record by Fetch or another method
matcher Search condition substring matcher
tmp_str_buffer Temporary string used for search in non-text fields
Returns:
0 if value not found

Definition at line 114 of file bdb_util.cpp.

References BDB_find_field(), BDB_GetUFieldIdx(), CBDB_File::GetDataBuffer(), and CBDB_File::GetKeyBuffer().

Referenced by BDB_find_field(), CScannerFunctorArgN::IsAnyField(), and CScannerEvaluateFunc::operator()().

int BDB_get_rowid const CBDB_File dbf  ) 
 

Return record id (integer key).

Returns:
record integer key or 0 if it cannot be retrived

Definition at line 145 of file bdb_util.cpp.

References fi, CBDB_FieldInt2::Get(), CBDB_FieldInt4::Get(), CBDB_FieldUint4::Get(), CBDB_BufferManager::GetField(), and CBDB_File::GetKeyBuffer().

Referenced by CLDS_IdTableScanner::OnRecordFound().

template<class FL, class IT, class Func>
void BDB_iterate_file FL &  dbf,
IT  start,
IT  finish,
Func &  func
 

Iterate file following the sequence of ids BDB file should have an integer key.

Definition at line 66 of file bdb_util.hpp.

References _ASSERT, eBDB_Ok, CBDB_BufferManager::FieldCount(), CBDB_BufferManager::GetField(), and IBDB_FieldConvert::SetInt().

template<class FL, class Func>
void BDB_iterate_file FL &  dbf,
Func &  func
 

Template algorithm function to iterate the BDB File.

Func() is called for every dbf record.

Definition at line 53 of file bdb_util.hpp.

References eBDB_Ok, CBDB_FileCursor::eFirst, CBDB_FileCursor::Fetch(), and CBDB_FileCursor::SetCondition().

Referenced by CLDS_Object::BuildSeqIdIdx(), CLDS_Query::CSequenceFinder::FindInCandidates(), CLDS_Query::FindSeqIdList(), and CLDS_DataLoader::GetRecords().


Generated on Mon Dec 7 16:02:12 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:36 2009 by modify_doxy.py rev. 173732