![]() |
Storage Engine API
|
This is the fixed width data component for storage of a key within a bucket. More...
#include <btree_ondisk.h>
This is the fixed width data component for storage of a key within a bucket.
It contains an offset pointer to the variable width bson data component. This may be 'unused', please see below.
Why is this templated on Loc? Because V0 and V1 have different size DiskLoc(s) but otherwise the same layout.
Public Member Functions | |
short | keyDataOfs () const |
void | setKeyDataOfs (short s) |
void | setKeyDataOfsSavingUse (short s) |
void | setUnused () |
Unused keys are not returned by read operations. More... | |
void | setUsed () |
int | isUnused () const |
int | isUsed () const |
Public Attributes | |
LocType | prevChildBucket |
The 'left' child bucket of this key. More... | |
LocType | recordLoc |
The location of the record associated with this key. More... | |
unsigned short | _kdo |
Offset within current bucket of the variable width bson key for this _KeyNode. More... | |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Unused keys are not returned by read operations.
Keys may be marked as unused in cases where it is difficult to delete them while maintaining the constraints required of a btree.
Setting ofs to odd is the sentinel for unused, as real recordLoc's are always even numbers. Note we need to keep its value basically the same as we use the recordLoc as part of the key in the index (to handle duplicate keys efficiently).
Flagging keys as unused is a feature that is being phased out in favor of deleting the keys outright. The current btree implementation is not expected to mark a key as unused in a non legacy btree.
|
inline |
unsigned short mongo::FixedWidthKey< LocType >::_kdo |
Offset within current bucket of the variable width bson key for this _KeyNode.
LocType mongo::FixedWidthKey< LocType >::prevChildBucket |
The 'left' child bucket of this key.
If this is the i-th key, it points to the i index child bucket.
LocType mongo::FixedWidthKey< LocType >::recordLoc |
The location of the record associated with this key.