taco-db
0.1.0
|
A pure abstract iterator over items (i.e., plain byte arrays). More...
#include <extsort/ItemIterator.h>
Public Member Functions | |
virtual | ~ItemIterator () |
Destructor. More... | |
virtual bool | Next ()=0 |
Subclass implementation should override the Next() function for moving to the next item . More... | |
virtual const char * | GetCurrentItem (FieldOffset &p_reclen)=0 |
Returns the current serialized item that a previous Next() call moved this iterator to. More... | |
virtual bool | SupportsRewind () const =0 |
Whether the subclass implementation supports rewinding. More... | |
virtual uint64_t | SavePosition () const =0 |
Saves the current posision if the subclass implementation supports rewinding. More... | |
virtual void | Rewind (uint64_t pos)=0 |
Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewinding. More... | |
virtual void | EndScan ()=0 |
Ends the scan. More... | |
A pure abstract iterator over items (i.e., plain byte arrays).
An implementation may optionally supports rewinding (e.g., the output iterator of ExtSort). One may check if the underlying support allows rewinding by calling the virtual function SupportsRewind().
The rewind interface uses a uint64_t position (rather than RecordId). See below for explanation.
|
inlinevirtual |
Destructor.
|
pure virtual |
Ends the scan.
Implemented in taco::ExternalSort::OutputIterator.
|
pure virtual |
Returns the current serialized item that a previous Next()
call moved this iterator to.
p_reclen
is set to the length of the item upon return.
Implemented in taco::ExternalSort::OutputIterator.
|
pure virtual |
Subclass implementation should override the Next() function for moving to the next item .
Upon a successful return, GetCurrentItem()
should return a pointer to a byte array which contains the item (which may be a heap record, an index record or something else). The interpretation of the record is up to the caller.
Implemented in taco::ExternalSort::OutputIterator.
|
pure virtual |
Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewinding.
The argument pos
must be a value previously returned by a call to SavePosition() on this iterator, otherwise it is undefined.
It is undefined if called on a ItemIterator such that this->SupportsRewind() == false
.
Implemented in taco::ExternalSort::OutputIterator.
|
pure virtual |
Saves the current posision if the subclass implementation supports rewinding.
The position is expressed as an opaque uint64_t rather than RecordId (which may fit into a uint64_t), so that the implementation can actually store other kinds of position pointer/index.
It is undefined if called on a ItemIterator such that this->SupportsRewind() == false
.
Implemented in taco::ExternalSort::OutputIterator.
|
pure virtual |
Whether the subclass implementation supports rewinding.
Implemented in taco::ExternalSort::OutputIterator.