Storage Engine API
mongo::BtreeLogicTestBase< BtreeLayoutType > Class Template Reference

This class is made friend of BtreeLogic so we can add whatever private method accesses we need to it, to be used by the tests. More...

#include <btree_logic.h>

Detailed Description

template<class BtreeLayoutType>
class mongo::BtreeLogicTestBase< BtreeLayoutType >

This class is made friend of BtreeLogic so we can add whatever private method accesses we need to it, to be used by the tests.

Public Types

typedef BtreeLayoutType::BucketType BucketType
 
typedef BtreeLayoutType::FixedWidthKeyType FixedWidthKeyType
 
typedef BtreeLogic< BtreeLayoutType >::FullKey FullKey
 
typedef BtreeLogic< BtreeLayoutType >::KeyDataOwnedType KeyDataOwnedType
 

Public Member Functions

 BtreeLogicTestBase ()
 
virtual ~BtreeLogicTestBase ()
 

Protected Member Functions

void checkValidNumKeys (int nKeys)
 
Status insert (const BSONObj &key, const DiskLoc dl, bool dupsAllowed=true)
 
bool unindex (const BSONObj &key)
 
void locate (const BSONObj &key, int expectedPos, bool expectedFound, const RecordId &expectedLocation, int direction)
 
void locate (const BSONObj &key, int expectedPos, bool expectedFound, const DiskLoc &expectedLocation, int direction)
 
const BucketTypechild (const BucketType *bucket, int i) const
 
BucketTypehead () const
 
void forcePackBucket (const RecordId bucketLoc)
 
void truncateBucket (BucketType *bucket, int N, int &refPos)
 
int bucketPackedDataSize (BucketType *bucket, int refPos)
 
int bucketRebalancedSeparatorPos (const RecordId bucketLoc, int leftIndex)
 
FullKey getKey (const RecordId bucketLoc, int pos) const
 
void markKeyUnused (const DiskLoc bucketLoc, int keyPos)
 
DiskLoc newBucket ()
 
void setBucketNextChild (const DiskLoc bucketLoc, const DiskLoc nextChild)
 Sets the nextChild pointer for the bucket at the specified location. More...
 

Protected Attributes

BtreeLogicTestHelper< BtreeLayoutType > _helper
 

Member Typedef Documentation

◆ BucketType

template<class BtreeLayoutType>
typedef BtreeLayoutType::BucketType mongo::BtreeLogicTestBase< BtreeLayoutType >::BucketType

◆ FixedWidthKeyType

template<class BtreeLayoutType>
typedef BtreeLayoutType::FixedWidthKeyType mongo::BtreeLogicTestBase< BtreeLayoutType >::FixedWidthKeyType

◆ FullKey

template<class BtreeLayoutType>
typedef BtreeLogic<BtreeLayoutType>::FullKey mongo::BtreeLogicTestBase< BtreeLayoutType >::FullKey

◆ KeyDataOwnedType

template<class BtreeLayoutType>
typedef BtreeLogic<BtreeLayoutType>::KeyDataOwnedType mongo::BtreeLogicTestBase< BtreeLayoutType >::KeyDataOwnedType

Constructor & Destructor Documentation

◆ BtreeLogicTestBase()

template<class BtreeLayoutType>
mongo::BtreeLogicTestBase< BtreeLayoutType >::BtreeLogicTestBase ( )
inline

◆ ~BtreeLogicTestBase()

template<class BtreeLayoutType>
virtual mongo::BtreeLogicTestBase< BtreeLayoutType >::~BtreeLogicTestBase ( )
inlinevirtual

Member Function Documentation

◆ bucketPackedDataSize()

template<class BtreeLayoutType>
int mongo::BtreeLogicTestBase< BtreeLayoutType >::bucketPackedDataSize ( BucketType bucket,
int  refPos 
)
inlineprotected

◆ bucketRebalancedSeparatorPos()

template<class BtreeLayoutType>
int mongo::BtreeLogicTestBase< BtreeLayoutType >::bucketRebalancedSeparatorPos ( const RecordId  bucketLoc,
int  leftIndex 
)
inlineprotected

◆ checkValidNumKeys()

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::checkValidNumKeys ( int  nKeys)
inlineprotected

◆ child()

template<class BtreeLayoutType>
const BucketType* mongo::BtreeLogicTestBase< BtreeLayoutType >::child ( const BucketType bucket,
int  i 
) const
inlineprotected

◆ forcePackBucket()

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::forcePackBucket ( const RecordId  bucketLoc)
inlineprotected

◆ getKey()

template<class BtreeLayoutType>
FullKey mongo::BtreeLogicTestBase< BtreeLayoutType >::getKey ( const RecordId  bucketLoc,
int  pos 
) const
inlineprotected

◆ head()

template<class BtreeLayoutType>
BucketType* mongo::BtreeLogicTestBase< BtreeLayoutType >::head ( ) const
inlineprotected

◆ insert()

template<class BtreeLayoutType>
Status mongo::BtreeLogicTestBase< BtreeLayoutType >::insert ( const BSONObj &  key,
const DiskLoc  dl,
bool  dupsAllowed = true 
)
inlineprotected

◆ locate() [1/2]

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::locate ( const BSONObj &  key,
int  expectedPos,
bool  expectedFound,
const RecordId &  expectedLocation,
int  direction 
)
inlineprotected

◆ locate() [2/2]

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::locate ( const BSONObj &  key,
int  expectedPos,
bool  expectedFound,
const DiskLoc expectedLocation,
int  direction 
)
inlineprotected

◆ markKeyUnused()

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::markKeyUnused ( const DiskLoc  bucketLoc,
int  keyPos 
)
inlineprotected

◆ newBucket()

template<class BtreeLayoutType>
DiskLoc mongo::BtreeLogicTestBase< BtreeLayoutType >::newBucket ( )
inlineprotected

◆ setBucketNextChild()

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::setBucketNextChild ( const DiskLoc  bucketLoc,
const DiskLoc  nextChild 
)
inlineprotected

Sets the nextChild pointer for the bucket at the specified location.

◆ truncateBucket()

template<class BtreeLayoutType>
void mongo::BtreeLogicTestBase< BtreeLayoutType >::truncateBucket ( BucketType bucket,
int  N,
int &  refPos 
)
inlineprotected

◆ unindex()

template<class BtreeLayoutType>
bool mongo::BtreeLogicTestBase< BtreeLayoutType >::unindex ( const BSONObj &  key)
inlineprotected

Member Data Documentation

◆ _helper

template<class BtreeLayoutType>
BtreeLogicTestHelper<BtreeLayoutType> mongo::BtreeLogicTestBase< BtreeLayoutType >::_helper
protected

The documentation for this class was generated from the following files: