![]() |
Storage Engine API
|
Bulk builds a unique index. More...
Bulk builds a unique index.
In order to support unique indexes in dupsAllowed mode this class only does an actual insert after it sees a key after the one we are trying to insert. This allows us to gather up all duplicate ids and insert them all together. This is necessary since bulk cursors can only append data.
Public Member Functions | |
UniqueBulkBuilder (WiredTigerIndex *idx, OperationContext *opCtx, bool dupsAllowed, KVPrefix prefix) | |
Status | addKey (const BSONObj &newKey, const RecordId &id) override |
Adds 'key' to intermediate storage. More... | |
void | commit (bool mayInterrupt) override |
Do any necessary work to finish building the tree. More... | |
![]() | |
BulkBuilder (WiredTigerIndex *idx, OperationContext *opCtx, KVPrefix prefix) | |
~BulkBuilder () | |
![]() | |
virtual | ~SortedDataBuilderInterface () |
Private Member Functions | |
Status | addKeyTimestampSafe (const BSONObj &newKey, const RecordId &id) |
Status | addKeyTimestampUnsafe (const BSONObj &newKey, const RecordId &id) |
void | doInsert () |
Private Attributes | |
WiredTigerIndex * | _idx |
const bool | _dupsAllowed |
KeyString | _keyString |
std::vector< std::pair< RecordId, KeyString::TypeBits > > | _records |
BSONObj | _previousKey |
Additional Inherited Members | |
![]() | |
WT_CURSOR * | openBulkCursor (WiredTigerIndex *idx) |
void | setKey (WT_CURSOR *cursor, const WT_ITEM *item) |
![]() | |
const Ordering | _ordering |
OperationContext *const | _opCtx |
UniqueWiredTigerSession const | _session |
WT_CURSOR *const | _cursor |
KVPrefix | _prefix |
|
inline |
|
inlineoverridevirtual |
Adds 'key' to intermediate storage.
'key' must be > or >= the last key passed to this function (depends on _dupsAllowed). If this is violated an error Status (ErrorCodes::InternalError) will be returned.
Implements mongo::SortedDataBuilderInterface.
|
inlineprivate |
|
inlineprivate |
|
inlineoverridevirtual |
Do any necessary work to finish building the tree.
The default implementation may be used if no commit phase is necessary because addKey always leaves the tree in a valid state.
This is called outside of any WriteUnitOfWork to allow implementations to split this up into multiple units.
Reimplemented from mongo::SortedDataBuilderInterface.
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |