Storage Engine API
mongo::BtreeBucketV0 Struct Reference

This structure represents header data for a btree bucket. More...

#include <btree_ondisk.h>

Detailed Description

This structure represents header data for a btree bucket.

An object of this type is typically allocated inside of a buffer of size BucketSize, resulting in a full bucket with an appropriate header.

The body of a btree bucket contains an array of _KeyNode objects starting from its lowest indexed bytes and growing to higher indexed bytes. The body also contains variable width bson keys, which are allocated from the highest indexed bytes toward lower indexed bytes.

|hhhh|kkkkkkk-----—bbbbbbbbbbbuuubbbuubbb| h = header data k = KeyNode data

  • = empty space b = bson key data u = unused (old) bson key data, that may be garbage collected

Public Types

enum  { HeaderSize = 40 }
 

Public Attributes

DiskLoc parent
 Parent bucket of this bucket, which isNull() for the root bucket. More...
 
DiskLoc nextChild
 Given that there are n keys, this is the n index child. More...
 
unsigned short _wasSize
 Can be reused, value is 8192 in current pdfile version Apr2010. More...
 
unsigned short _reserved1
 zero More...
 
int flags
 
int emptySize
 basicInsert() assumes the next three members are consecutive and in this order: More...
 
int topSize
 Size used for bson storage, including storage of old keys. More...
 
int n
 
int reserved
 
char data [4]
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
HeaderSize 

Member Data Documentation

◆ _reserved1

unsigned short mongo::BtreeBucketV0::_reserved1

zero

◆ _wasSize

unsigned short mongo::BtreeBucketV0::_wasSize

Can be reused, value is 8192 in current pdfile version Apr2010.

◆ data

char mongo::BtreeBucketV0::data[4]

◆ emptySize

int mongo::BtreeBucketV0::emptySize

basicInsert() assumes the next three members are consecutive and in this order:

Size of the empty region.

◆ flags

int mongo::BtreeBucketV0::flags

◆ n

int mongo::BtreeBucketV0::n

◆ nextChild

DiskLoc mongo::BtreeBucketV0::nextChild

Given that there are n keys, this is the n index child.

◆ parent

DiskLoc mongo::BtreeBucketV0::parent

Parent bucket of this bucket, which isNull() for the root bucket.

◆ reserved

int mongo::BtreeBucketV0::reserved

◆ topSize

int mongo::BtreeBucketV0::topSize

Size used for bson storage, including storage of old keys.


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