(
constvector<IMergeVolumeWalker*>& vol_vector,
130 switch(GetErrCode())
216 virtual const unsigned char*
GetBufferPtr(
size_t* buf_size)
const= 0;
Main volume merge algorithm class.
void SetMergeStore(IMergeStore *store, EOwnership own=eTakeOwnership)
Set merge store (destination)
TBufResourcePool & GetBufResourcePool()
Get BLOB buffer pool.
void x_MergeVolume(IMergeVolumeWalker *volume)
void SetVolumes(const vector< IMergeVolumeWalker * > &vol_vector, EOwnership own=eTakeOwnership)
Set merge volumes.
CSimpleBuffer TRawBuffer
Raw BLOB buffer type used for raw information exchange between merge algorithm interfaces Raw buffers...
AutoPtr< IMergeBlob > m_Merger
TBufResourcePool m_BufResourcePool
void Run()
Execute merge process (main merge loop)
vector< size_t > m_MinKeyCandidates
min-key volumes
void x_MergeCandidates()
Merge all discovered min key candidates.
EOwnership m_OwnVolumeVect
CResourcePool< TRawBuffer, CFastMutex > TBufResourcePool
Memory manager for raw buffers to avoid unnecessary reallocations and memory fragmentation.
AutoPtr< IMergeStore > m_Store
unsigned m_MergeKey
key in the merger
void x_EvaluateMinKey(unsigned new_key, size_t volume_idx)
check if volume key is new minimum or equals to old minimum
void SetMergeAccumulator(IMergeBlob *merger, EOwnership own=eTakeOwnership)
Set merge accumulator component.
vector< IMergeVolumeWalker * > m_VolumeVect
void x_ResetMinKey()
Reset min. evaluation.
unsigned m_MinKey
min key value
CResourcePoolGuard< TBufResourcePool > TBufPoolGuard
Buffer pool guard.
Base Merge algorithms exception class.
NCBI_EXCEPTION_DEFAULT(CMerge_Exception, CException)
virtual const char * GetErrCodeString(void) const
Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...
BLOB merge interface, merges one or more BLOBs together.
CMergeVolumes::TBufResourcePool * m_BufResourcePool
void SetResourcePool(CMergeVolumes::TBufResourcePool &res_pool)
Set resource pool for BLOB buffer memory management.
virtual void Reset()=0
Reset merging, forget all the accumulated buffers.
virtual CMergeVolumes::TRawBuffer * GetMergeBuffer()=0
Returns destination (merged) buffer Caller MUST return the buffer to the buffer pool.
virtual void Merge(CMergeVolumes::TRawBuffer *buffer)=0
Merge request Implementation MUST return the buffer to the pool.
Include a standard set of the NCBI C++ Toolkit most basic headers.
@ eTakeOwnership
An object can take ownership of another.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
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.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
Defines NCBI C++ exception handling.
Miscellaneous common-use basic types and functionality.
Multi-threading â mutexes; rw-locks; semaphore.
virtual EStatus GetStatus() const =0
Get current interface async. status.
@ eNoMoreData
Interface reached the end (EOF)
@ eFailed
Last operation failed and interface cannot recover.
@ eReady
Volume is ready.
@ eNotReady
Last request did not finish yet.
virtual ~IAsyncInterface()
virtual EStatus WaitReady() const =0
Wait until interface is ready (or operation fails) (On failure volume is free to throw an exception)
Interface to store merged BLOBs.
virtual void Close()=0
Close storage (when it ends) Method is responsible for finalization of store procedure,...
virtual IAsyncInterface * QueryIAsync()=0
Get pointer to async.
virtual CMergeVolumes::TRawBuffer * ReadBlob(Uint4 blob_id)=0
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)=0
Store BLOB request This request can be asyncronous caller needs to check status using IAsyncInterface...
virtual bool IsGood() const =0
Return TRUE if storage device is in good shape.
void SetResourcePool(CMergeVolumes::TBufResourcePool &res_pool)
Set resource pool for BLOB buffer memory management.
CMergeVolumes::TBufResourcePool * m_BufResourcePool
Interface to traverse volume for merge.
virtual bool IsEof() const =0
Return TRUE when volume traverse reaches the end.
virtual bool IsGood() const =0
Return TRUE if volume is in good condition (not failed)
virtual void Close()=0
Close volume (when it ends) Method is responsible for finalization of merge procedure (it could be de...
virtual void FetchFirst()=0
Request to start fetching data This request can be asyncronous caller needs to check status using IAs...
virtual ~IMergeVolumeWalker()
virtual Uint4 GetUint4Key() const =0
Get access to the key as unsigned integer (if this type is supported)
virtual void Fetch()=0
Request to get next record This request can be asyncronous caller needs to check status using IAsyncI...
virtual const unsigned char * GetKeyPtr() const =0
Get low level access to the current key buffer.
virtual IAsyncInterface * QueryIAsync()=0
Get pointer to async.
virtual const unsigned char * GetBufferPtr(size_t *buf_size) const =0
Get low level access to the merge BLOB buffer and buffer size (next Fetch call invalidates this point...
virtual void SetRecordMoved()=0
Signals that current record moved to merged storage (volume manager may decide to delete it later) Vo...
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