fetch_buffer_size = 10 * 1024 * 1024);
68 virtual bool IsGood()
const{
return true; }
70 virtual void Fetch();
73 virtual const unsigned char*
GetBufferPtr(
size_t* buf_size)
const 78 return(
unsigned char*)
m_Data;
108 size_tfetch_buffer_size = 10 * 1024 * 1024);
112 virtual bool IsEof()
const;
113 virtual bool IsGood()
const;
115 virtual void Fetch();
116 virtual const unsigned char*
GetKeyPtr()
const;
118 virtual const unsigned char*
GetBufferPtr(
size_t* buf_size)
const;
119 virtual void Close();
148 default:
return st;
192 template<
classBStore>
203 virtual bool IsGood()
const{
return true; }
216 template<
classBStore>
227 virtual bool IsGood()
const;
229 virtual void Close();
259 default:
return st;
303 size_tfetch_buffer_size)
304: m_BlobFile(blob_file, own),
305m_FetchBufferSize(fetch_buffer_size),
320 if(m_FetchBufferSize) {
321m_Cursor->InitMultiFetch(m_FetchBufferSize);
333m_Data = m_Cursor->GetLastMultiFetchData();
334m_DataLen = m_Cursor->GetLastMultiFetchDataLen();
340m_KeyPtr =(
const unsigned char*) ptr;
356 template<
classBStore>
359: m_BlobStore(blob_store, own)
363 template<
classBStore>
368 template<
classBStore>
378 template<
classBStore>
393 template<
classBStore>
397m_BlobStore(blob_store, own),
406 template<
classBStore>
411 template<
classBStore>
417 if(m_Request_Buffer == 0) {
418m_JobThread->RequestStop();
426 template<
classBStore>
433 template<
classBStore>
438 if(m_Request_Buffer) {
441m_Request_BlobId = blob_id;
442m_Request_Buffer =
buffer;
443m_JobThread->RequestDoJob();
446 template<
classBStore>
450guard(*(this->m_BufResourcePool), m_Request_Buffer);
453 if(!m_Request_Buffer) {
459&((*m_Request_Buffer)[0]),
460m_Request_Buffer->size());
464m_Request_Buffer = 0;
472 template<
classBStore>
493 size_tfetch_buffer_size)
494: m_BlobFile(blob_file, own),
495m_FetchBufferSize(fetch_buffer_size),
530 if(m_FetchBufferSize) {
531m_Cursor->InitMultiFetch(m_FetchBufferSize,
539m_JobThread->RequestDoJob();
560m_Data = m_Cursor->GetLastMultiFetchData();
561m_DataLen = m_Cursor->GetLastMultiFetchDataLen();
566m_KeyPtr =(
const unsigned char*) ptr;
581m_JobThread->RequestDoJob();
593 if(m_Data || !m_Cursor.get()) {
605m_Data = m_Cursor->GetLastMultiFetchData();
606m_DataLen = m_Cursor->GetLastMultiFetchDataLen();
611m_KeyPtr =(
const unsigned char*) ptr;
650 const unsigned char*
655*buf_size = m_DataLen;
657 return(
unsigned char*)m_Data;
663m_JobThread->RequestStop();
BDB library BLOB support.
Berkeley BDB file cursor.
BDB Data Field Buffer manager class.
Base class for constructing BDB fields.
Berkeley DB file cursor class.
Background thread class (executes async requests)
Generic iterator to traverse any CBDB_BLobFile for volume merge BF - any CBDB_BLobFile derived class ...
Generic iterator to traverse any CBDB_BLobFile for volume merge BF - any CBDB_BLobFile derived class.
Background thread class (executes async requests)
Merge store saves result to BLOB store.
Merge store saves result to BLOB store.
Base Merge algorithms exception class.
Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...
Adaptation of CThread class repeatedly running some job.
@ eTakeOwnership
An object can take ownership of another.
CBDB_MergeStore(TBlobStore *blob_store, EOwnership own=eTakeOwnership)
const unsigned char * m_KeyPtr
virtual void SetRecordMoved()
Signals that current record moved to merged storage (volume manager may decide to delete it later) Vo...
CBDB_MergeBlobWalker(TBlobFile *blob_file, EOwnership own=eTakeOwnership, size_t fetch_buffer_size=10 *1024 *1024)
virtual IAsyncInterface * QueryIAsync()
Get pointer to async.
CJobThread(TMainClass &impl)
virtual CMergeVolumes::TRawBuffer * ReadBlob(Uint4 blob_id)
Read buffer with the specified blob_id This method is for store update, when we are merging into an e...
virtual void Store(Uint4 blob_id, CMergeVolumes::TRawBuffer *buffer)
Store BLOB request This request can be asyncronous caller needs to check status using IAsyncInterface...
virtual EStatus WaitReady() const
Wait until interface is ready (or operation fails) (On failure volume is free to throw an exception)
AutoPtr< TBlobFile > m_BlobFile
virtual void DoJob(void)
Do job delegated processing to the main class.
virtual const unsigned char * GetBufferPtr(size_t *buf_size) const
Get low level access to the merge BLOB buffer and buffer size (next Fetch call invalidates this point...
CMergeVolumes::TRawBuffer * m_Request_Buffer
virtual IAsyncInterface * QueryIAsync()
Get pointer to async.
virtual void Fetch()
Request to get next record This request can be asyncronous caller needs to check status using IAsyncI...
virtual void FetchFirst()
Request to start fetching data This request can be asyncronous caller needs to check status using IAs...
virtual bool IsGood() const
Return TRUE if storage device is in good shape.
AutoPtr< TBlobStore > m_BlobStore
CJobThread(TMainClass &impl)
virtual IAsyncInterface * QueryIAsync()
Get pointer to async.
unique_ptr< CBDB_FileCursor > m_Cursor
CBDB_MergeStoreAsync(TBlobStore *blob_store, EOwnership own=eTakeOwnership)
virtual void SetRecordMoved()
Signals that current record moved to merged storage (volume manager may decide to delete it later) Vo...
CBDB_MergeBlobWalkerAsync< BF > TMainClass
virtual bool IsGood() const
Return TRUE if volume is in good condition (not failed)
virtual EStatus GetStatus() const
Get current interface async. status.
virtual bool IsEof() const
Return TRUE when volume traverse reaches the end.
virtual const unsigned char * GetKeyPtr() const
Get low level access to the current key buffer.
AutoPtr< TBlobStore > m_BlobStore
virtual CMergeVolumes::TRawBuffer * ReadBlob(Uint4 blob_id)
Read buffer with the specified blob_id This method is for store update, when we are merging into an e...
virtual ~CBDB_MergeBlobWalker()
virtual ~CBDB_MergeStoreAsync()
virtual ~CBDB_MergeBlobWalkerAsync()
virtual void DoJob(void)
Do job delegated processing to the main class.
virtual bool IsGood() const
Return TRUE if volume is in good condition (not failed)
virtual EStatus WaitReady() const
Wait until interface is ready (or operation fails) (On failure volume is free to throw an exception)
virtual void Fetch()
Request to get next record This request can be asyncronous caller needs to check status using IAsyncI...
virtual void Close()
Close volume (when it ends) Method is responsible for finalization of merge procedure (it could be de...
CRef< CJobThread > m_JobThread
virtual bool IsGood() const
Return TRUE if storage device is in good shape.
virtual void Close()
Close storage (when it ends) Method is responsible for finalization of store procedure,...
virtual EStatus GetStatus() const
Get current interface async. status.
unique_ptr< CBDB_FileCursor > m_Cursor
virtual Uint4 GetUint4Key() const
Get access to the key as unsigned integer (if this type is supported)
virtual Uint4 GetUint4Key() const
Get access to the key as unsigned integer (if this type is supported)
const unsigned char * m_KeyPtr
CBDB_MergeBlobWalkerAsync(TBlobFile *blob_file, EOwnership own=eTakeOwnership, size_t fetch_buffer_size=10 *1024 *1024)
virtual void Close()
Close storage (when it ends) Method is responsible for finalization of store procedure,...
virtual const unsigned char * GetBufferPtr(size_t *buf_size) const
Get low level access to the merge BLOB buffer and buffer size (next Fetch call invalidates this point...
virtual void FetchFirst()
Request to start fetching data This request can be asyncronous caller needs to check status using IAs...
virtual const unsigned char * GetKeyPtr() const
Get low level access to the current key buffer.
AutoPtr< TBlobFile > m_BlobFile
virtual void Close()
Close volume (when it ends) Method is responsible for finalization of merge procedure (it could be de...
CBDB_MergeStoreAsync< BStore > TMainClass
virtual void Store(Uint4 blob_id, CMergeVolumes::TRawBuffer *buffer)
Store BLOB request This request can be asyncronous caller needs to check status using IAsyncInterface...
virtual IAsyncInterface * QueryIAsync()
Get pointer to async.
virtual ~CBDB_MergeStore()
virtual bool IsEof() const
Return TRUE when volume traverse reaches the end.
CRef< CJobThread > m_JobThread
EBDB_ErrCode
BDB Return codes.
virtual unsigned GetUint() const
const CBDB_Field & GetField(unsigned int idx) const
const void * GetBuffer() const
Get pointer to the data. NULL if not yet attached.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
uint32_t Uint4
4-byte (32-bit) unsigned integer
Pool::TValue * Release()
Return the pointer to the caller, not to the pool.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
Multi-threading â mutexes; rw-locks; semaphore.
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
@ eFailed
Last operation failed and interface cannot recover.
@ eReady
Volume is ready.
@ eNotReady
Last request did not finish yet.
Interface to store merged BLOBs.
Interface to traverse volume for merge.
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