diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-01-06 14:25:45 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-01-09 14:21:49 -0500 |
commit | aa0d807497e09fcee93a21b437b354ad0dcffd11 (patch) | |
tree | 51ee50e890847df986eebf0a645c067212114075 /src/mongo/db/index/btree_access_method.cpp | |
parent | ea5d43f74e4ddf990a156ce37b05369cd9ee3479 (diff) | |
download | mongo-aa0d807497e09fcee93a21b437b354ad0dcffd11.tar.gz |
SERVER-12213: merge BtreInMemoryState and IndexCatalogEntry
Diffstat (limited to 'src/mongo/db/index/btree_access_method.cpp')
-rw-r--r-- | src/mongo/db/index/btree_access_method.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mongo/db/index/btree_access_method.cpp b/src/mongo/db/index/btree_access_method.cpp index f3317725bdd..d73ae59e321 100644 --- a/src/mongo/db/index/btree_access_method.cpp +++ b/src/mongo/db/index/btree_access_method.cpp @@ -37,11 +37,10 @@ #include "mongo/db/keypattern.h" #include "mongo/db/pdfile.h" #include "mongo/db/pdfile_private.h" -#include "mongo/db/structure/btree/state-inl.h" namespace mongo { - BtreeBasedAccessMethod::BtreeBasedAccessMethod(BtreeInMemoryState* btreeState) + BtreeBasedAccessMethod::BtreeBasedAccessMethod(IndexCatalogEntry* btreeState) : _btreeState(btreeState), _descriptor(btreeState->descriptor()) { verify(0 == _descriptor->version() || 1 == _descriptor->version()); @@ -181,15 +180,18 @@ namespace mongo { } DiskLoc BtreeBasedAccessMethod::findSingle( const BSONObj& key ) { + DiskLoc head = _btreeState->head(); + Record* record = _btreeState->recordStore()->recordFor( head ); + if ( 0 == _descriptor->version() ) { - return _btreeState->getHeadBucket<V0>()->findSingle( _btreeState, - _btreeState->head(), - key ); + return BtreeBucket<V0>::asVersion( record )->findSingle( _btreeState, + _btreeState->head(), + key ); } if ( 1 == _descriptor->version() ) { - return _btreeState->getHeadBucket<V1>()->findSingle( _btreeState, - _btreeState->head(), - key ); + return BtreeBucket<V1>::asVersion( record )->findSingle( _btreeState, + _btreeState->head(), + key ); } verify( 0 ); } @@ -274,7 +276,7 @@ namespace mongo { } // Standard Btree implementation below. - BtreeAccessMethod::BtreeAccessMethod(BtreeInMemoryState* btreeState) + BtreeAccessMethod::BtreeAccessMethod(IndexCatalogEntry* btreeState) : BtreeBasedAccessMethod(btreeState) { // The key generation wants these values. |