#include <wiredtiger_record_store.h>
|
virtual RecordId | getKey (WT_CURSOR *cursor) const =0 |
|
virtual void | setKey (WT_CURSOR *cursor, RecordId id) const =0 |
|
virtual bool | hasWrongPrefix (WT_CURSOR *cursor, RecordId *id) const =0 |
| Callers must have already checked the return value of a positioning method against 'WT_NOTFOUND'. More...
|
|
virtual void | initCursorToBeginning ()=0 |
| Called when restoring a cursor that has not been advanced. More...
|
|
◆ WiredTigerRecordStoreCursorBase()
mongo::WiredTigerRecordStoreCursorBase::WiredTigerRecordStoreCursorBase |
( |
OperationContext * |
opCtx, |
|
|
const WiredTigerRecordStore & |
rs, |
|
|
bool |
forward |
|
) |
| |
◆ detachFromOperationContext()
void mongo::WiredTigerRecordStoreCursorBase::detachFromOperationContext |
( |
| ) |
|
|
virtual |
Detaches from the OperationContext and releases any storage-engine state.
It is only legal to call this when in a "saved" state. While in the "detached" state, it is only legal to call reattachToOperationContext or the destructor. It is not legal to call detachFromOperationContext() while already in the detached state.
Implements mongo::RecordCursor.
◆ getKey()
virtual RecordId mongo::WiredTigerRecordStoreCursorBase::getKey |
( |
WT_CURSOR * |
cursor | ) |
const |
|
protectedpure virtual |
◆ hasWrongPrefix()
virtual bool mongo::WiredTigerRecordStoreCursorBase::hasWrongPrefix |
( |
WT_CURSOR * |
cursor, |
|
|
RecordId * |
id |
|
) |
| const |
|
protectedpure virtual |
Callers must have already checked the return value of a positioning method against 'WT_NOTFOUND'.
This method allows for additional predicates to be considered on a validly positioned cursor. 'id' is an out parameter. Implementations are not required to fill it in. It's simply a possible optimization to avoid a future 'getKey' call if 'hasWrongPrefix' already did one.
Implemented in mongo::WiredTigerRecordStorePrefixedCursor, and mongo::WiredTigerRecordStoreStandardCursor.
◆ initCursorToBeginning()
virtual void mongo::WiredTigerRecordStoreCursorBase::initCursorToBeginning |
( |
| ) |
|
|
protectedpure virtual |
◆ isVisible()
bool mongo::WiredTigerRecordStoreCursorBase::isVisible |
( |
const RecordId & |
id | ) |
|
|
private |
◆ next()
boost::optional< Record > mongo::WiredTigerRecordStoreCursorBase::next |
( |
| ) |
|
|
virtual |
Moves forward and returns the new data or boost::none if there is no more data.
Continues returning boost::none once it reaches EOF.
Implements mongo::RecordCursor.
◆ reattachToOperationContext()
void mongo::WiredTigerRecordStoreCursorBase::reattachToOperationContext |
( |
OperationContext * |
opCtx | ) |
|
|
virtual |
Reattaches to the OperationContext and reacquires any storage-engine state.
It is only legal to call this in the "detached" state. On return, the cursor is left in a "saved" state, so callers must still call restoreState to use this object.
Implements mongo::RecordCursor.
◆ restore()
bool mongo::WiredTigerRecordStoreCursorBase::restore |
( |
| ) |
|
|
virtual |
Recovers from potential state changes in underlying data.
Returns false if it is invalid to continue using this iterator. This usually means that capped deletes have caught up to the position of this iterator and continuing could result in missed data.
If the former position no longer exists, but it is safe to continue iterating, the following call to next() will return the next closest position in the direction of the scan, if any.
This handles restoring after either save() or SeekableRecordCursor::saveUnpositioned().
Implements mongo::RecordCursor.
◆ save()
void mongo::WiredTigerRecordStoreCursorBase::save |
( |
| ) |
|
|
virtual |
Prepares for state changes in underlying data in a way that allows the cursor's current position to be restored.
It is safe to call save multiple times in a row. No other method (excluding destructor) may be called until successfully restored.
Implements mongo::RecordCursor.
◆ saveUnpositioned()
void mongo::WiredTigerRecordStoreCursorBase::saveUnpositioned |
( |
| ) |
|
|
virtual |
Prepares for state changes in underlying data without necessarily saving the current state.
The cursor's position when restored is unspecified. Caller is expected to seek rather than call next() following the restore.
It is safe to call saveUnpositioned multiple times in a row. No other method (excluding destructor) may be called until successfully restored.
Reimplemented from mongo::SeekableRecordCursor.
◆ seekExact()
boost::optional< Record > mongo::WiredTigerRecordStoreCursorBase::seekExact |
( |
const RecordId & |
id | ) |
|
|
virtual |
Seeks to a Record with the provided id.
If an exact match can't be found, boost::none will be returned and the resulting position of the cursor is unspecified.
Implements mongo::SeekableRecordCursor.
◆ setKey()
virtual void mongo::WiredTigerRecordStoreCursorBase::setKey |
( |
WT_CURSOR * |
cursor, |
|
|
RecordId |
id |
|
) |
| const |
|
protectedpure virtual |
◆ _cursor
boost::optional<WiredTigerCursor> mongo::WiredTigerRecordStoreCursorBase::_cursor |
|
protected |
◆ _eof
bool mongo::WiredTigerRecordStoreCursorBase::_eof = false |
|
protected |
◆ _forward
const bool mongo::WiredTigerRecordStoreCursorBase::_forward |
|
protected |
◆ _lastReturnedId
RecordId mongo::WiredTigerRecordStoreCursorBase::_lastReturnedId |
|
protected |
◆ _opCtx
OperationContext* mongo::WiredTigerRecordStoreCursorBase::_opCtx |
|
protected |
◆ _rs
◆ _skipNextAdvance
bool mongo::WiredTigerRecordStoreCursorBase::_skipNextAdvance = false |
|
protected |
The documentation for this class was generated from the following files: