summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/catalog/index_catalog.cpp5
-rw-r--r--src/mongo/db/catalog/index_create.cpp3
-rw-r--r--src/mongo/db/index/btree_access_method.cpp4
-rw-r--r--src/mongo/db/index/btree_based_builder.cpp1
-rw-r--r--src/mongo/db/index/index_descriptor.h23
5 files changed, 8 insertions, 28 deletions
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp
index 5a2d7654f2b..7dded9b47fe 100644
--- a/src/mongo/db/catalog/index_catalog.cpp
+++ b/src/mongo/db/catalog/index_catalog.cpp
@@ -247,7 +247,7 @@ namespace mongo {
IndexDetails* id = &_details->idx(idxNo);
scoped_ptr<IndexDescriptor> desc( new IndexDescriptor( _collection, idxNo,
- id, id->info.obj().getOwned() ) );
+ id->info.obj().getOwned() ) );
auto_ptr<BtreeInMemoryState> btreeState( createInMemory( desc.get() ) );
buildAnIndex( _collection, btreeState.get(), mayInterrupt );
indexBuildBlock.success();
@@ -727,7 +727,6 @@ namespace mongo {
IndexDetails& id = _details->idx( i );
fassert( 17227, _descriptorCache[i]->_indexNumber == static_cast<int>( i ) );
fassert( 17228, id.info.obj() == _descriptorCache[i]->_infoObj );
- fassert( 17229, &id == _descriptorCache[i]->_onDiskData );
}
}
@@ -857,7 +856,7 @@ namespace mongo {
_descriptorCache.resize( idxNo + 1 );
_descriptorCache[idxNo] = new IndexDescriptor( _collection, idxNo,
- id, id->info.obj().getOwned());
+ id->info.obj().getOwned());
return _descriptorCache[idxNo];
}
diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp
index 4c71ee681e7..d43bb68b449 100644
--- a/src/mongo/db/catalog/index_create.cpp
+++ b/src/mongo/db/catalog/index_create.cpp
@@ -114,7 +114,6 @@ namespace mongo {
prep( ns );
try {
- //idx->getOnDisk().head.writing() = BtreeBasedBuilder::makeEmptyIndex( idx->getOnDisk() );
btreeState->setHead( BtreeBasedBuilder::makeEmptyIndex( btreeState ) );
unsigned long long n = addExistingToIndex( collection, btreeState->descriptor() );
// idx may point at an invalid index entry at this point
@@ -248,7 +247,7 @@ namespace mongo {
if( inDBRepair || !idxInfo["background"].trueValue() ) {
n = BtreeBasedBuilder::fastBuildIndex( collection, btreeState, mayInterrupt );
- verify( !idx->getHead().isNull() );
+ verify( !btreeState->head().isNull() );
}
else {
BackgroundIndexBuildJob j( ns );
diff --git a/src/mongo/db/index/btree_access_method.cpp b/src/mongo/db/index/btree_access_method.cpp
index 37cd69ca3d0..f88d5249f5e 100644
--- a/src/mongo/db/index/btree_access_method.cpp
+++ b/src/mongo/db/index/btree_access_method.cpp
@@ -169,7 +169,7 @@ namespace mongo {
bool unusedFound;
DiskLoc unusedDiskLoc;
_interface->locate(_btreeState.get(),
- _descriptor->getHead(),
+ _btreeState->head(),
*i,
unusedPos,
unusedFound,
@@ -197,7 +197,7 @@ namespace mongo {
Status BtreeBasedAccessMethod::validate(int64_t* numKeys) {
*numKeys = _interface->fullValidate(_btreeState.get(),
- _descriptor->getHead(),
+ _btreeState->head(),
_descriptor->keyPattern());
return Status::OK();
}
diff --git a/src/mongo/db/index/btree_based_builder.cpp b/src/mongo/db/index/btree_based_builder.cpp
index 57abfda90ef..acd24d76d76 100644
--- a/src/mongo/db/index/btree_based_builder.cpp
+++ b/src/mongo/db/index/btree_based_builder.cpp
@@ -206,7 +206,6 @@ namespace mongo {
DiskLoc myNull;
myNull.Null();
btreeState->setHead( myNull );
- //getDur().writingDiskLoc(idx->getOnDisk().head).Null();
}
if ( logger::globalLogDomain()->shouldLog(logger::LogSeverity::Debug(2) ) )
diff --git a/src/mongo/db/index/index_descriptor.h b/src/mongo/db/index/index_descriptor.h
index 81e164c9a4f..abcd557e0f2 100644
--- a/src/mongo/db/index/index_descriptor.h
+++ b/src/mongo/db/index/index_descriptor.h
@@ -42,14 +42,6 @@ namespace mongo {
class IndexCatalog;
/**
- * OnDiskIndexData (aka IndexDetails) is memory-mapped on-disk index data.
- * It contains two DiskLocs:
- * The first points to the head of the index. This is currently turned into a Btree node.
- * The second points to a BSONObj which describes the index.
- */
- typedef IndexDetails OnDiskIndexData;
-
- /**
* A cache of information computed from the memory-mapped per-index data (OnDiskIndexData).
* Contains accessors for the various immutable index parameters, and an accessor for the
* mutable "head" pointer which is index-specific.
@@ -62,10 +54,9 @@ namespace mongo {
* OnDiskIndexData is a pointer to the memory mapped per-index data.
* infoObj is a copy of the index-describing BSONObj contained in the OnDiskIndexData.
*/
- IndexDescriptor(Collection* collection, int indexNumber, OnDiskIndexData* data,
- BSONObj infoObj)
+ IndexDescriptor(Collection* collection, int indexNumber,BSONObj infoObj)
: _magic(123987),
- _collection(collection), _indexNumber(indexNumber), _onDiskData(data),
+ _collection(collection), _indexNumber(indexNumber),
_infoObj(infoObj.getOwned()),
_numFields(infoObj.getObjectField("key").nFields()),
_keyPattern(infoObj.getObjectField("key").getOwned()),
@@ -91,7 +82,7 @@ namespace mongo {
// XXX this is terrible
IndexDescriptor* clone() const {
- return new IndexDescriptor(_collection, _indexNumber, _onDiskData, _infoObj);
+ return new IndexDescriptor(_collection, _indexNumber,_infoObj);
}
//
@@ -154,12 +145,6 @@ namespace mongo {
// "Internals" of accessing the index, used by IndexAccessMethod(s).
//
- // Return the memory-mapped index data block.
- OnDiskIndexData& getOnDisk() { _checkOk(); return *_onDiskData; }
-
- // Return the mutable head of the index.
- const DiskLoc& getHead() const { _checkOk(); return _onDiskData->head; }
-
// Return a (rather compact) string representation.
string toString() const { _checkOk(); return _infoObj.toString(); }
@@ -202,8 +187,6 @@ namespace mongo {
// and getting multikey.
int _indexNumber;
- OnDiskIndexData* _onDiskData;
-
// The BSONObj describing the index. Accessed through the various members above.
const BSONObj _infoObj;