capacity =
buffer.capacity();
97 if(capacity >
buffer.size()) {
98 buffer.resize_mem(capacity);
100 if(
buffer.size() == 0) {
248m_BlobSize(blob_size)
283 m_DBT_Data->flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
296 BDB_CHECK(ret,
"CBDB_BlobReaderWriter");
306 size_t* bytes_written)
308 m_DBT_Data->flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
321 BDB_CHECK(ret,
"CBDB_BlobReaderWriter");
325*bytes_written =
count;
349m_BlobSize(blob_size)
374 m_DBT_Data->flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
398 m_DBT_Data->flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
413 m_Pos+= (unsigned)buf_size;
457can_update?0:DB_NOOVERWRITE
459 if(ret == DB_KEYEXIST)
529 if(ret == DB_NOTFOUND)
537 if((ret == DB_BUFFER_SMALL) && (
m_DBT_Data->data == 0)) {
574 if(ret == DB_NOTFOUND)
586 #if DB_VERSION_MAJOR >= 6 588 typedef int(*BDB_CompareFunction_V6)(
DB*,
const DBT*,
const DBT*,
590 intBDB_Uint4Compare_V6(
DB* db,
const DBT* dbt1,
const DBT* dbt2,
size_t*)
592 intBDB_ByteSwap_Uint4Compare_V6(
DB* db,
const DBT* dbt1,
const DBT* dbt2,
600 #if DB_VERSION_MAJOR >= 6 601BDB_CompareFunction_V6 func = BDB_Uint4Compare_V6;
603func = BDB_ByteSwap_Uint4Compare_V6;
613 intret =
m_DB->set_bt_compare(
m_DB, func);
BDB library BLOB support.
Wrapper around Berkeley DB transaction structure.
int(* BDB_CompareFunction)(DB *, const DBT *, const DBT *)
Berkeley DB BLOB File class.
Berkeley DB BLOB File stream.
Stream style BDB BLOB reader.
BDB errno exception class.
static Int4 GetInt4(const unsigned char *ptr)
Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...
A very basic data-read interface.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read)
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
size_t LobSize() const
Get LOB size. Becomes available right after successfull Fetch.
virtual ERW_Result Write(const void *buf, size_t count, size_t *bytes_written)
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
size_t LobSize() const
Get LOB size. Becomes available right after successfull Fetch.
EBDB_ErrCode Insert(const void *data, size_t size)
Insert BLOB into the database.
CBDB_BLobFile(EDuplicateKeys dup_keys=eDuplicatesDisable, EDBType db_type=eBtree)
EBDB_ErrCode ReadRealloc(TBuffer &buffer)
Read BLOB into vector.
void SetTransaction(CBDB_Transaction *trans)
Set current transaction for BLOB stream.
void SetTransaction(CBDB_Transaction *trans)
Set current transaction.
EBDB_ErrCode Fetch(unsigned int lob_id)
Fetch LOB record.
EBDB_ErrCode UpdateInsert(const void *data, size_t size)
Insert or update BLOB.
EBDB_ErrCode GetData(void *buf, size_t size)
Copy LOB data into the 'buf'.
virtual void SetHash(DB *)
Hash for this type returns id (key);.
void Read(void *buf, size_t buf_size, size_t *bytes_read)
Read data from BLOB.
virtual void SetCmp(DB *)
Comparison function for unsigned int key.
EBDB_ErrCode Fetch()
Fetch the record corresponding to the current key value.
CBDB_IdBlobFile(EDuplicateKeys dup_keys=eDuplicatesDisable, EDBType db_type=eBtree)
EBDB_ErrCode x_Put(unsigned int lob_id, const void *data, size_t size, bool can_update)
CBDB_BLobStream * CreateStream()
Creates stream like object to retrieve or write BLOB by chunks.
EBDB_ErrCode Insert(unsigned int lob_id, const void *data, size_t size)
Insert BLOB data into the database, does nothing if key exists.
virtual ERW_Result PendingCount(size_t *count)
Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...
void Write(const void *buf, size_t buf_size)
Write data into BLOB.
CBDB_BlobReaderWriter * CreateReaderWriter()
Creates stream like object to retrieve or write BLOB by chunks.
CBDB_BLobStream(DB *db, DBT *dbt_key, size_t blob_size, DB_TXN *txn)
IReader * CreateReader()
Creates stream like object to read BLOB by chunks.
unsigned Append(const void *data, size_t size)
CBDB_BlobReaderWriter(DB *db, DBT *dbt_key, size_t blob_size, DB_TXN *txn)
EBDB_ErrCode GetData(void *buf, size_t size)
Copy LOB data into the 'buf'.
virtual ERW_Result Flush(void)
Flush pending data (if any) down to the output device.
CBDB_FieldUint4 id
ID key.
EBDB_ErrCode InsertUpdate(unsigned int lob_id, const void *data, size_t size)
Insert or Update BLOB data into the database.
unsigned Append(EAfterWrite write_flag=eDiscardData)
Append record to the queue (works only for DB_QUEUE database type)
static void DestroyDBT_Clone(DBT *dbt)
Free the DBT structure created by CloneDBT_Key.
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 DisableDataBufProcessing()
Function disables processing of m_DBT_data.
EBDB_ErrCode Insert(EAfterWrite write_flag=eDiscardData)
Insert new record.
EBDB_ErrCode UpdateInsert(EAfterWrite write_flag=eDiscardData)
Update record corresponding to the current key value.
EDBType
Berkeley DB database type.
EDuplicateKeys
Control key duplicates in Btree.
void BindKey(const char *field_name, CBDB_Field *key_field, size_t buf_size=0)
DB_TXN * GetTxn()
Get transaction handler.
EReallocMode
BLOB read mode, controld data buffer reallocation when there is not enough space in buffer.
const string & FileName() const
EBDB_ErrCode
BDB Return codes.
unsigned GetRecLen() const
Get record length Works for fixed length record DBs only (Queue)
EBDB_ErrCode Fetch()
Fetches the record corresponding to the current key value.
unsigned int BDB_Uint4Hash(DB *, const void *bytes, unsigned length)
Hash method for databases with a single (unique) UInt4 key.
int BDB_Uint4Compare(DB *, const DBT *val1, const DBT *val2)
int BDB_ByteSwap_Uint4Compare(DB *, const DBT *val1, const DBT *val2)
bool IsBufferSmall() const
Returns TRUE if error is BerekleyDB DB_BUFFER_SMALL (insufficient buffer size)
DB_TXN * GetTxn()
Get low level Berkeley DB transaction handle.
#define BDB_CHECK(errnum, x_db_object__)
bool IsNoMem() const
Returns TRUE if error is BerekleyDB ENOMEM (insufficient buffer size)
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.
ERW_Result
Result codes for I/O operations.
@ eRW_Success
Everything is okay, I/O completed.
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
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