A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/bdb__file_8cpp_source.html below:

NCBI C++ ToolKit: src/db/bdb/bdb_file.cpp Source File

47 #if DB_VERSION_MAJOR >= 4 48  #if DB_VERSION_MINOR >= 4 || DB_VERSION_MAJOR > 4 54 #define NCBI_USE_ERRCODE_X Db_Bdb_File 74

(*m_DB)->close(*

m_DB

, 0);

89

: m_Data_DBT(new

DBT

)

90

, m_Buf(new unsigned char[buf_size])

102  delete

[] (

unsigned char

*)(

m_Buf

);

127

: m_DB_Type(db_type),

139

m_DB_Attached(

false

),

140

m_ByteSwapped(

false

),

141

m_RevSplitOff(

false

),

142

m_CmpOverride(

true

),

144

m_CacheSize(256 * 1024),

145

m_DuplicateKeys(dup_keys),

186  "Cannot close the file while transaction is in progress."

);

214

DB_MPOOLFILE* mpf =

m_DB

->get_mpf(

m_DB

);

216

DB_CACHE_PRIORITY p = DB_PRIORITY_DEFAULT;

219

p = DB_PRIORITY_VERY_LOW;

227

p = DB_PRIORITY_DEFAULT;

230

p = DB_PRIORITY_HIGH;

233

p = DB_PRIORITY_VERY_HIGH;

236

mpf->set_priority(mpf, p);

286  ERR_POST_X

(3,

"Error "

<< ex.what() <<

" resetting LSN for " 301  bool

support_dirty_read,

315  x_Open

(filename.c_str(), db, open_mode, support_dirty_read, rec_len);

326  bool

support_dirty_read,

332  BDB_THROW

(eInvalidOperation,

"Cannot reopen attached object"

);

341

open_mode, support_dirty_read, rec_len);

346  const string

& old_name,

347  const string

& new_name)

352  "Cannot call rename on an opened database"

);

355  file

.c_str(), old_name.c_str(), new_name.c_str(),

363  const char

* db_name;

371  BDB_THROW

(eInvalidOperation,

"Cannot remove attached object"

);

381

ret = db->remove(db, filename.c_str(), db_name, 0);

383  if

(ret == ENOENT || ret == EINVAL)

416  m_DBT

.size = dbt.size;

418

memcpy(

m_DBT

.data, dbt.data, dbt.size);

436  const int

k_bulk_init = 1000;

437  int

bulk = k_bulk_init;

440

vector<DBT_ptr> keys;

441

keys.resize(k_bulk_init);

448

memset(&

key

, 0,

sizeof

(

key

));

449

memset(&

data

, 0,

sizeof

(

data

));

450  for

(nrec = 0; nrec < bulk && (ret = dbcp->c_get(dbcp, &

key

, &

data

, DB_NEXT)) == 0;

454  if

(dbcp) dbcp->c_close(dbcp);

456  if

(ret != DB_NOTFOUND) {

462  for

(

int n

= 0;

n

< nrec; ++

n

) {

463

ret =

m_DB

->del(

m_DB

, txn, *keys[

n

], 0);

466  if

(ret == 0) txn->commit(txn, 0);

473  if

(!

done

&& bulk < k_bulk_init && ++bulk_age > 3) {

475  if

(bulk > k_bulk_init) bulk = k_bulk_init;

481  if

(bulk == 0)

throw

;

508 #ifdef DB_COMPACT_FLAGS 515  flags

= DB_FREELIST_ONLY;

517  flags

= DB_FREE_SPACE;

520

target_fill_pct =

max

(target_fill_pct, 0);

523  unsigned int

pages_examined = 0;

524  unsigned int

pages_freed = 0;

525  unsigned int

levels_removed = 0;

526  unsigned int

pages_truncated = 0;

527  for

(

int i

= 0;

i

< 2; ++

i

) {

529

memset(&compact, 0,

sizeof

(compact));

530

compact.compact_fillpercent = target_fill_pct;

531

compact.compact_timeout = 0;

537

pages_examined += compact.compact_pages_examine;

538

pages_freed += compact.compact_pages_free;

539

levels_removed += compact.compact_levels;

540

pages_truncated += compact.compact_pages_truncated;

543

<<

"round "

<<

i

+ 1 <<

": " 544

<< compact.compact_pages_examine <<

" pages examined / " 545

<< compact.compact_pages_free <<

" pages freed / " 546

<< compact.compact_levels <<

" levels removed / " 547

<< compact.compact_pages_truncated <<

" pages truncated"

);

549  if

( !compact_callback() ) {

555

<< pages_examined <<

" pages examined / " 556

<< pages_freed <<

" pages freed / " 557

<< levels_removed <<

" levels removed / " 558

<< pages_truncated <<

" pages truncated"

);

648

ret =

m_DB

->set_flags(

m_DB

, DB_DUP);

653

ret =

m_DB

->set_flags(

m_DB

, DB_REVSPLITOFF);

662

ret =

m_DB

->set_re_len(

m_DB

, rec_len);

695  bool

support_dirty_read,

699  const char

* open_filename_param = filename;

700  if

(strlen(filename) == 0)

701

open_filename_param =

NULL

;

712

u_int32_t open_flags;

717

open_flags = DB_RDONLY;

720

open_flags = DB_CREATE;

731

open_flags |= DB_THREAD | DB_AUTO_COMMIT;

735  if

(support_dirty_read) {

736

open_flags |= DB_DIRTY_READ;

740

DBTYPE db_type = DB_BTREE;

781

ret =

m_DB

->get_byteswapped(

m_DB

, &isswapped);

814  if

(((page_size - 1) & page_size) != 0) {

815  BDB_THROW

(eInvalidValue,

"Page size must be power of 2"

);

840  flags

= DB_FAST_STAT;

848

u_int32_t rc = stp->bt_ndata;

857

DB_BTREE_STAT* stp = 0;

860  int

ret =

m_DB

->stat(

m_DB

, txn, &stp, 0);

865  out

<<

"bt_version : "

<< stp->bt_version <<

NcbiEndl 866

<<

"bt_nkeys : "

<< stp->bt_nkeys <<

NcbiEndl 867

<<

"bt_ndata : "

<< stp->bt_ndata <<

NcbiEndl 868

<<

"bt_pagesize : "

<< stp->bt_pagesize <<

NcbiEndl 869

<<

"bt_levels : "

<< stp->bt_levels <<

NcbiEndl 870

<<

"bt_int_pg : "

<< stp->bt_int_pg <<

NcbiEndl 871

<<

"bt_leaf_pg : "

<< stp->bt_leaf_pg <<

NcbiEndl 872

<<

"bt_dup_pg : "

<< stp->bt_dup_pg <<

NcbiEndl 873

<<

"bt_over_pg : "

<< stp->bt_over_pg <<

NcbiEndl 874

<<

"bt_empty_pg : "

<< stp->bt_empty_pg <<

NcbiEndl 875

<<

"bt_free : "

<< stp->bt_free <<

NcbiEndl 876

<<

"bt_int_pgfree : "

<< stp->bt_int_pgfree <<

NcbiEndl 877

<<

"bt_leaf_pgfree: "

<< stp->bt_leaf_pgfree<<

NcbiEndl 878

<<

"bt_dup_pgfree : "

<< stp->bt_dup_pgfree <<

NcbiEndl 879

<<

"bt_over_pgfree: "

<< stp->bt_over_pgfree<<

NcbiEndl 890

u_int32_t open_flags = DB_CREATE;

896

open_flags |= DB_THREAD | DB_AUTO_COMMIT;

900

DBTYPE db_type = DB_BTREE;

914  const char

* open_filename_param = filename;

915  if

(strlen(filename) == 0)

916

open_filename_param =

NULL

;

934  unsigned int flags

)

const 939  BDB_THROW

(eInvalidValue,

"Cannot create cursor for unopen file."

);

976  int

ret = db->set_h_hash(db,

BDB_Hash

);

998  data

->data = usr_data;

1001  unsigned

bytes_compressed;

1002 #ifdef HAVE_UNALIGNED_READS 1003

bytes_compressed = *((

unsigned

*)compressed);

1005

::memcpy(&bytes_compressed, compressed, 4);

1008  if

(bytes_compressed == 0) {

1011

::memcpy(

data

->data, compressed + 4,

data

->size);

1014  if

(

data

->ulen < bytes_compressed) {

1015  data

->size = bytes_compressed;

1016  return

DB_BUFFER_SMALL;

1027  data

->size = bytes_compressed;

1032  _ASSERT

(dst_len == bytes_compressed);

1053  void

* usr_data =

data

->data;

1075  void

* usr_data =

data

->data;

1101  void

* usr_data =

data

->data;

1102  unsigned

usr_size =

data

->size;

1106  bool

compressed =

false

;

1112 #ifdef HAVE_UNALIGNED_READS 1115

::memset(

buf

, 0, 4);

1126 #ifdef HAVE_UNALIGNED_READS 1127

*

buf

= (unsigned)dst_len;

1129

::memcpy(

buf

, &dst_len, 4);

1137 #ifdef HAVE_UNALIGNED_READS 1140

::memset(

buf

, 0, 4);

1153  data

->data = usr_data;

1154  data

->size = usr_size;

1172  void

* usr_data =

data

->data;

1173  unsigned

usr_size =

data

->size;

1177  bool

compressed =

false

;

1183 #ifdef HAVE_UNALIGNED_READS 1186

::memset(

buf

, 0, 4);

1196 #ifdef HAVE_UNALIGNED_READS 1197

*

buf

= (unsigned)dst_len;

1199

::memcpy(

buf

, &dst_len, 4);

1207 #ifdef HAVE_UNALIGNED_READS 1210

::memset(

buf

, 0, 4);

1223  data

->data = usr_data;

1224  data

->size = usr_size;

1244

m_BufsAttached(

false

),

1245

m_BufsCreated(

false

),

1246

m_DataBufDisabled(

false

),

1247

m_LegacyString(

false

),

1248

m_OwnFields(

false

),

1249

m_DisabledNull(

false

),

1250

m_PrefixCompress(

false

)

1258  m_KeyBuf

->SetFieldOwnership(own_fields);

1260  m_DataBuf

->SetFieldOwnership(own_fields);

1289

key_field->

SetName

(field_name);

1304

data_field->

SetName

(field_name);

1311  if

( buf_size > 0) {

1323  bool

support_dirty_read,

1333

rec_len = (unsigned)

m_DataBuf

->ComputeBufferSize();

1338

open_mode, support_dirty_read, rec_len);

1347  unsigned

rec_len = 0;

1350

rec_len = (unsigned)

m_DataBuf

->ComputeBufferSize();

1359  m_KeyBuf

->SetByteSwapped(byte_swapped);

1361  m_DataBuf

->SetByteSwapped(byte_swapped);

1404  m_DB

->verify(

m_DB

, filename,

database

, backup, backup ? DB_SALVAGE: 0);

1416  if

(ret == DB_NOTFOUND) {

1422  if

((ret == ENOMEM || ret == DB_BUFFER_SMALL)

1444

::memset(dbt, 0,

sizeof

(

DBT

));

1450  unsigned char

* p = (

unsigned char

*)

malloc

(dbt->ulen);

1453

dbt->flags = DB_DBT_USERMEM;

1460  unsigned char

* p = (

unsigned char

*)dbt->data;

1470  unsigned int flags

;

1474  flags

=

DB_NOOVERWRITE;

1481  unsigned int flags

= DB_APPEND;

1484

memcpy(&rec_id,

m_DBT_Key

->data,

sizeof

(rec_id));

1492  return x_Write

(0, write_flag);

1506  if

(ret == DB_NOTFOUND) {

1535  cnt

= 1;

len

=

a

->size >

b

->size ?

b

->size :

a

->size;

1536

p1 = (

char

*)

a

->data, p2 = (

char

*)

b

->data;

1537  for

(;

len

--; ++p1, ++p2, ++

cnt

) {

1542  if

(

a

->size <

b

->size)

return

(

a

->size + 1);

1543  if

(

b

->size <

a

->size)

return

(

b

->size + 1);

1548 #if DB_VERSION_MAJOR >= 6 1562 #if DB_VERSION_MAJOR >= 6 1567  int

ret = db->set_bt_compare(db, func);

1584

fidx =

m_KeyBuf

->GetFieldIndex(name);

1656  key

->CopyFrom(*src_key);

1658  data

->CopyFrom(*src_data);

1670  m_KeyBuf

->DuplicateStructureFrom(*src_key);

1674  m_DataBuf

->DuplicateStructureFrom(*src_data);

1706  unsigned int

bdb_flag,

1711  if

(

buf

->size() == 0) {

1714  if

(

buf

->size() <

buf

->capacity()) {

1715  buf

->resize(

buf

->capacity());

1728  buf

->resize_mem(0);

1732  buf

->resize_mem(0);

1734  case

DB_BUFFER_SMALL:

1748  unsigned int

bdb_flag,

1769  "Use of dynamic reallocation on compressed file - not implemented"

);

1795  unsigned int

bdb_flag,

1800

db_recno_t recno = 0;

1801  if

(multirow_buf == 0) {

1807  if

(multirow_buf->

m_BufPtr

!= 0) {

1812

DB_MULTIPLE_KEY_NEXT(multirow_buf->

m_BufPtr

,

1823

DB_MULTIPLE_RECNO_NEXT(multirow_buf->

m_BufPtr

,

1838  if

(multirow_buf->

m_BufPtr

!= 0) {

1841  if

(multirow_only) {

1845  if

(multirow_only) {

1861

bdb_flag | DB_MULTIPLE_KEY);

1881

DB_MULTIPLE_KEY_NEXT(multirow_buf->

m_BufPtr

,

1892

DB_MULTIPLE_RECNO_NEXT(multirow_buf->

m_BufPtr

,

1907  if

(multirow_buf->

m_BufPtr

== 0) {

1919  unsigned char

* uncompressed_data =

1920

(

unsigned char

*) multirow_buf->

m_LastData

;

1921  unsigned

bytes_compressed;

1923

bytes_compressed = *((

unsigned

*)multirow_buf->

m_LastData

);

1925

::memcpy(&bytes_compressed, multirow_buf->

m_LastData

, 4);

1927

uncompressed_data += 4;

1929  if

(bytes_compressed == 0) {

1930  m_DataBuf

->CopyPackedFrom(uncompressed_data,

1971  unsigned int

bdb_flag,

1975  BDB_THROW

(eInvalidOperation,

"BLOB operation on non BLOB table"

);

1987  int

ret =

dbc

->c_del(

dbc

, 0);

1999  if

(

m_KeyBuf

->FieldCount() == 0) {

2000  BDB_THROW

(eInvalidValue,

"Empty BDB key (no fields defined)."

);

2059  if

(ret == DB_KEYEXIST)

2084 #if DB_VERSION_MAJOR >= 6 2086  typedef int

(*BDB_CompareFunction_V6)(

DB

*,

const DBT

*,

const DBT

*,

2088  int

BDB_Int4Compare_V6(

DB

* db,

const DBT

* dbt1,

const DBT

* dbt2,

size_t

*)

2090  int

BDB_ByteSwap_Int4Compare_V6(

DB

* db,

const DBT

* dbt1,

const DBT

* dbt2,

2098 #if DB_VERSION_MAJOR >= 6 2099

BDB_CompareFunction_V6 func = BDB_Int4Compare_V6;

2101

func = BDB_ByteSwap_Int4Compare_V6;

2111  int

ret =

m_DB

->set_bt_compare(

m_DB

, func);

Wrapper around Berkeley DB environment structure.

const unsigned k_BDB_CompressionCutOff

Record size cut off for compression.

static bool s_DefaultCompactCallback()

Compact the database.

size_t BDB_compare_prefix(DB *, const DBT *a, const DBT *b)

Wrapper around Berkeley DB transaction structure.

int(* BDB_CompareFunction)(DB *, const DBT *, const DBT *)

BDB Data Field Buffer manager class.

BDB environment object a collection including support for some or all of caching, locking,...

BDB errno exception class.

Base BDB exception class.

Base class for constructing BDB fields.

Multirow buffer for reading many rows in one call.

Raw file class wraps up basic Berkeley DB operations.

Auto-pointer style guard class for DB structure.

Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...

const value_type * data() const

void resize_mem(size_type new_size)

Resize the buffer. No data preservation.

DBT_ptr & operator=(const DBT &dbt)

std::ofstream out("events_result.xml")

main entry point for tests

void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)

Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...

element_type * get(void) const

Get pointer.

ENullable

Whether a value is nullable.

@ eNullable

Value can be null.

void SetCompressor(ICompression *compressor, EOwnership own=eTakeOwnership)

Set record compressor.

string m_Database

db name in file (optional)

unsigned Append(EAfterWrite write_flag=eDiscardData)

Append record to the queue (works only for DB_QUEUE database type)

unsigned int Truncate()

Empty the database. Return number of records removed.

void SetCacheSize(unsigned int cache_size)

Set Berkeley DB memory cache size for the file (default is 256K).

CBDB_Transaction * m_Trans

void Rename(const string &fname, const string &old_name, const string &new_name)

Rename a database. NOTE: This cannot be called on an opened file.

CBDB_MultiRowBuffer(size_t buf_size)

EBDB_ErrCode Delete(EIgnoreError on_error=eThrowOnError)

Delete record corresponding to the current key value.

static void DestroyDBT_Clone(DBT *dbt)

Free the DBT structure created by CloneDBT_Key.

void x_Open(const char *filename, const char *database, EOpenMode open_mode, bool support_dirty_read, unsigned rec_len)

const CBDB_Field & GetField(TUnifiedFieldIndex idx) const

Return field by field index.

void x_EndRead()

Record reading epilog function.

void DisableDataPacking()

Disable packing of variable length fields in the data buffer (Call after BindData)

size_t m_BufSize

buffer size

void Compact(ECompact compact_type=eCompactNoFree, int target_fill_pct=0)

Compact the database.

void * m_LastData

Last data pointer returned by DB_MULTIPLE_KEY_NEXT.

AutoPtr< ICompression > m_Compressor

Record compressor.

unsigned int GetBtreeMinKeysPerPage()

bool IsOpen() const

Return TRUE if the file is open.

virtual void SetCmp(DB *)=0

Set comparison function.

ECompact

BerkeleyDB compaction methods and flags.

void SetLegacyStringsCheck(bool value)

Set C-str detection.

DBT * m_Data_DBT

Temp DBT for multiple fetch.

void RevSplitOff()

Turn OFF reverse splitting.

void Attach(CBDB_File &db_file)

Attach external Berkeley DB file.

EBDB_ErrCode FetchForUpdate()

Fetche the record corresponding to the current key value.

void SetFieldOwnership(bool own_fields)

Fields deletion is managed by the class when own_fields is TRUE.

void CopyFrom(const CBDB_File &dbf)

Copy record (fields) from another BDB file (MUST have the same structure)

EBDB_ErrCode x_Fetch(unsigned int flags)

Wrapper around get operation.

void x_SetTransaction(CBDB_Transaction *trans)

Set current transaction.

EOpenMode

BDB file open mode.

void Discard()

Unpack internal record buffers.

void SetHashFillFactor(unsigned h_ffactor)

Set hash table density (fill factor)

void x_Close(EIgnoreError close_mode)

void Sync()

Flush any cached information to disk.

void * m_Buf

Multiple row buffer.

void Verify(const char *filename, const char *database, FILE *backup)

Run database verification (DB->verify)

void DuplicateStructure(const CBDB_File &dbf)

Create the same fieldset as in dbf and bind them to the current file.

void SetCachePriority(ECachePriority priority)

virtual void RemoveTransaction(ITransaction *trans)

Remove transaction association (must be established by SetTransaction.

void SetHashNelem(unsigned h_nelem)

Set an estimate of hash table final size.

int x_DBC_Fetch(DBC *dbc, DBT *key, DBT *data, unsigned flags)

Internal override for DBC->c_get(...) This method overrides destination buffer and uses compressor: S...

bool IsByteSwapped() const

Return TRUE if the if the underlying database files were created on an architecture of the different ...

DBT * CloneDBT_Key()

Create new copy of m_DBT_Key.

void Open(const string &filename, EOpenMode open_mode, bool support_dirty_read=false, unsigned rec_len=0)

Open file with specified access mode.

CBDB_Transaction * GetBDBTransaction()

Get current transaction.

CBDB_File::TUnifiedFieldIndex BDB_GetUFieldIdx(int fidx, bool key)

Make field index in CBDB_File format.

void x_ConstructDataBuf()

int x_DB_CPut(DBC *dbc, DBT *key, DBT *data, unsigned flags)

Override for DBC->c_put(...) Handles compression.

void SetBtreeMinKeysPerPage(unsigned int keys_per_page)

Set the minimum number of keys per page (BTREE access methods only)

void x_RemoveTransaction(CBDB_Transaction *trans)

void x_Create(const char *filename, const char *database)

TUnifiedFieldIndex GetFieldIdx(const string &name) const

Get field index by name.

unsigned int SafeTruncate()

Workaround for truncate of large databases.

EBDB_ErrCode Insert(EAfterWrite write_flag=eDiscardData)

Insert new record.

bool m_CmpOverride

TRUE - NCBI BDB sets its own cmp.

unique_ptr< CBDB_BufferManager > m_DataBuf

EBDB_ErrCode UpdateInsert(EAfterWrite write_flag=eDiscardData)

Update record corresponding to the current key value.

unsigned CountRecs(bool bFast=false)

Compute database statistic, return number of records.

EBDB_ErrCode ReadCursor(DBC *dbc, unsigned int bdb_flag)

Read DB cursor.

CBDB_RawFile(EDuplicateKeys dup_keys=eDuplicatesDisable, EDBType db_type=eBtree)

void CompactEx(FContinueCompact compact_callback, ECompact compact_type=eCompactNoFree, int target_fill_pct=0)

void SetEnv(CBDB_Env &env)

Associate file with environment.

unsigned int GetPageSize()

virtual void SetHash(DB *)

Set hash function.

bool m_RevSplitOff

TRUE if reverse splitting is off.

EDBType

Berkeley DB database type.

virtual void SetTransaction(ITransaction *trans)

Establish transaction association.

string m_FileName

filename

void PrintStat(CNcbiOstream &out)

Print database statistics.

int x_FetchBufferDecompress(DBT *data, void *usr_data)

void * m_LastKey

Last key pointer returned by DB_MULTIPLE_KEY_NEXT.

EBDB_ErrCode DeleteCursor(DBC *dbc, EIgnoreError)

Delete DB cursor.

virtual void SetCmp(DB *db)

Set comparison function.

void Reopen(EOpenMode open_mode, bool support_dirty_read=false, unsigned rec_len=0)

Reopen database file. (Should be already open).

int TUnifiedFieldIndex

CBDB_File keeps data in two buffers (key buffer and data buffer).

void Attach(CBDB_RawFile &bdb_file)

Attach class to external BerkeleyDB file instance.

void Remove(const string &filename, const string &database=kEmptyStr)

Remove the database specified by the filename and database arguments.

void x_CreateDB(unsigned rec_len)

Create m_DB member, set page, cache parameters.

EDuplicateKeys

Control key duplicates in Btree.

EBDB_ErrCode WriteCursor(DBC *dbc, unsigned int bdb_flag, EAfterWrite write_flag)

Write DB cursor.

DBC * CreateCursor(CBDB_Transaction *trans=0, unsigned int flags=0) const

Create DB cursor.

static const char kDefaultDatabase[]

static int x_CompareShim(DB *db, const DBT *dbt1, const DBT *dbt2, size_t *locp)

void BindKey(const char *field_name, CBDB_Field *key_field, size_t buf_size=0)

DB_TXN * GetTxn()

Get transaction handler.

bool m_ByteSwapped

TRUE if file created on a diff.arch.

EReallocMode

BLOB read mode, controld data buffer reallocation when there is not enough space in buffer.

const CBDB_BufferManager * GetKeyBuffer() const

Get Buffer manager for key section of the file.

void BindData(const char *field_name, CBDB_Field *data_field, size_t buf_size=0, ENullable is_null=eNullable)

int x_DB_Put(DBT *key, DBT *data, unsigned flags)

Override for DB->put(...) Handles compression.

virtual void x_SetByteSwapped(bool bswp)

Set byte order swapping.

ECachePriority

Set the priority for this database's pages in the buffer cache This is generally a temporary adviseme...

void Reopen(EOpenMode open_mode, bool support_dirty_read=false)

Reopen the db file.

virtual ITransaction * GetTransaction()

Get current transaction.

void Open(const string &filename, EOpenMode open_mode, bool support_dirty_read=false, unsigned rec_len=0)

Open file with specified access mode.

static const int kOpenFileMask

const string & FileName() const

EBDB_ErrCode

BDB Return codes.

const CBDB_BufferManager * GetDataBuffer() const

Get Buffer manager for data section of the file.

void * m_BufPtr

current buffer position

CBDB_File(EDuplicateKeys dup_keys=eDuplicatesDisable, EDBType db_type=eBtree)

void x_CheckConstructBuffers()

virtual void SetCmp(DB *)

Set comparison function.

void SetPageSize(unsigned int page_size)

void CheckNullDataConstraint() const

Check if all NOT NULL fields are assigned.

bool m_PrefixCompress

TRUE if prefix compression ON.

unique_ptr< CBDB_BufferManager > m_KeyBuf

bool DuplicatesAllowed() const

Return TRUE if file can contain duplicate keys.

void x_StartRead()

Record reading prolog function.

int x_DB_Fetch(DBT *key, DBT *data, unsigned flags)

Internal override for DB->get(...) This method overrides destination buffer and uses compressor: Shou...

bool m_DB_Attached

TRUE if m_DB doesn't belong here.

virtual void x_SetByteSwapped(bool bswp)

Set byte order swapping.

EBDB_ErrCode x_Write(unsigned int flags, EAfterWrite write_flag, DBC *dbc=0)

@ eDiscardData

Invalidate the inserted data immediately after write.

@ eReadWriteCreate

read-write, create if it doesn't exist

@ eCreate

implies 'eReadWrite' too

unsigned int BDB_Hash(DB *, const void *bytes, unsigned length)

General purpose hash function.

int BDB_ByteSwap_Int4Compare(DB *, const DBT *val1, const DBT *val2)

void SetName(const char *name)

Set symbolic name for the field.

void SetDataSize(size_t size)

Set data size, taking into account possible extra data for some fields.

BDB_CompareFunction GetCompareFunction() const

Return buffer compare function.

int BDB_Int4Compare(DB *, const DBT *val1, const DBT *val2)

void SetNullable()

Mark field as "NULL" capable.

EKeepFileAssociation GetAssociationMode() const

Transaction file association mode.

virtual void Add(ITransactional *dbfile)

Add file to the list of connected files.

void LsnResetForMemLog(const char *file_name)

Reset log sequence number if environment logs are in memory.

#define BDB_THROW(errcode, message)

static CBDB_Transaction * CastTransaction(ITransaction *trans)

Downcast ITransaction.

virtual void Remove(ITransactional *dbfile)

Remove file from the list of connected files.

bool IsInProgress() const

Return TRUE if transaction handle has been requested by some client (File)

DB_ENV * GetEnv()

Return underlying DB_ENV structure pointer for low level access.

DB_TXN * GetTxn()

Get low level Berkeley DB transaction handle.

DB_TXN * CreateTxn(DB_TXN *parent_txn=0, unsigned int flags=0)

Start transaction (DB_ENV->txn_begin)

bool IsTransactional() const

Return TRUE if environment has been open as transactional.

#define BDB_CHECK(errnum, x_db_object__)

bool IsNoMem() const

Returns TRUE if error is BerekleyDB ENOMEM (insufficient buffer size)

@ eFullAssociation

Transaction associated with files.

virtual bool CompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)=0

(De)compress the source buffer into the destination buffer.

virtual bool DecompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)=0

virtual string GetErrorDescription(void) const =0

#define LOG_POST_X(err_subcode, message)

#define ERR_POST_X(err_subcode, message)

Error posting with default error code and given error subcode.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

void Info(CExceptionArgs_Base &args)

uint32_t Uint4

4-byte (32-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.

enum ENcbiOwnership EOwnership

Ownership relations between objects.

unsigned int

A callback function used to compare two keys in a database.

Definition of all error codes used in bdb library (bdb.lib and ncbi_xcache_bdb.lib).

use only n Cassandra database for the lookups</td > n</tr > n< tr > n< td > yes</td > n< td > do not use tables BIOSEQ_INFO and BLOB_PROP in the Cassandra database

const struct ncbi::grid::netcache::search::fields::SIZE size

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

#define HAVE_UNALIGNED_READS


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