taco-db  0.1.0
Public Member Functions | Protected Attributes | List of all members
taco::BulkLoadIterator Class Referenceabstract

BulkLoadIterator is an interface for providing (key, RecordId) pairs for index bulk loading. More...

#include <index/BulkLoadIterator.h>

Inheritance diagram for taco::BulkLoadIterator:
taco::TableBulkLoadIterator taco::VolatileCatCache::InmemFileBulkLoadIterator

Public Member Functions

 BulkLoadIterator (const Schema *key_schema)
 Constructs a bulk load iterator with the key_schema. More...
 
virtual ~BulkLoadIterator ()
 Destructor. More...
 
virtual bool Next ()=0
 Subclass should override the Next() function for moving to the next (key, record id) pair. More...
 
const IndexKeyGetCurrentKey ()
 Returns the current key. More...
 
const RecordIdGetCurrentRecordId ()
 Returns the current record id. More...
 
virtual void EndScan ()=0
 Ends the scan. More...
 

Protected Attributes

const Schemam_key_schema
 
unique_malloced_ptr m_key
 
RecordId m_recid
 

Detailed Description

BulkLoadIterator is an interface for providing (key, RecordId) pairs for index bulk loading.

Different use cases may implement the Next() virtual function differently to iterate and construct the keys and record ids.

Constructor & Destructor Documentation

◆ BulkLoadIterator()

taco::BulkLoadIterator::BulkLoadIterator ( const Schema key_schema)
inline

Constructs a bulk load iterator with the key_schema.

The key_schema must remain alive for the duration that the bulk load iterator is alive.

◆ ~BulkLoadIterator()

virtual taco::BulkLoadIterator::~BulkLoadIterator ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ EndScan()

virtual void taco::BulkLoadIterator::EndScan ( )
pure virtual

Ends the scan.

If the subclass does want it to be called again in the destructor if it has been called, it should set m_key_schema to nullptr.

Implemented in taco::TableBulkLoadIterator, and taco::VolatileCatCache::InmemFileBulkLoadIterator.

◆ GetCurrentKey()

const IndexKey* taco::BulkLoadIterator::GetCurrentKey ( )
inline

Returns the current key.

Undefined if Next() has not been called or a previous call returns false.

◆ GetCurrentRecordId()

const RecordId& taco::BulkLoadIterator::GetCurrentRecordId ( )
inline

Returns the current record id.

Undefined if Next() has not been called or a previous call returns false.

◆ Next()

virtual bool taco::BulkLoadIterator::Next ( )
pure virtual

Subclass should override the Next() function for moving to the next (key, record id) pair.

Upon a successful return, Next() should call IndexKey::Construct on the preallocated IndexKey m_key, which is sufficient to hold key_schema->GetNumFields() references to the keys, and m_recid is set record id this key maps to.

Implemented in taco::TableBulkLoadIterator, and taco::VolatileCatCache::InmemFileBulkLoadIterator.

Member Data Documentation

◆ m_key

unique_malloced_ptr taco::BulkLoadIterator::m_key
protected

◆ m_key_schema

const Schema* taco::BulkLoadIterator::m_key_schema
protected

◆ m_recid

RecordId taco::BulkLoadIterator::m_recid
protected

The documentation for this class was generated from the following file: