diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-01-02 17:33:14 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-01-09 14:21:49 -0500 |
commit | fcfa7ac2bd4b8f2c3a007c10fbba4ed7b487630d (patch) | |
tree | 795537b5087a3ca6cd2fd3aab0a7b2d579324b6e /src/mongo/db/prefetch.cpp | |
parent | 10e1d82ec69683259f6c35cb349431a86ad70ef0 (diff) | |
download | mongo-fcfa7ac2bd4b8f2c3a007c10fbba4ed7b487630d.tar.gz |
SERVER-12213: removing IndexCatalog::getDescriptor( int )
trying to move away for index numbers being a thing one cares about
Diffstat (limited to 'src/mongo/db/prefetch.cpp')
-rw-r--r-- | src/mongo/db/prefetch.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp index 45ff5a00397..a9b7edfd6ef 100644 --- a/src/mongo/db/prefetch.cpp +++ b/src/mongo/db/prefetch.cpp @@ -136,11 +136,10 @@ namespace mongo { TimerHolder timer( &prefetchIndexStats); // on the update op case, the call to prefetchRecordPages will touch the _id index. // thus perhaps this option isn't very useful? - int indexNo = collection->details()->findIdIndex(); - if (indexNo == -1) return; try { - IndexDescriptor* desc = collection->getIndexCatalog()->getDescriptor(indexNo); - verify( desc ); + IndexDescriptor* desc = collection->getIndexCatalog()->findIdIndex(); + if ( !desc ) + return; IndexAccessMethod* iam = collection->getIndexCatalog()->getIndex( desc ); verify( iam ); iam->touch(obj); @@ -154,13 +153,12 @@ namespace mongo { { // indexCount includes all indexes, including ones // in the process of being built - int indexCount = collection->getIndexCatalog()->numIndexesTotal(); - for ( int indexNo = 0; indexNo < indexCount; indexNo++ ) { + IndexCatalog::IndexIterator ii = collection->getIndexCatalog()->getIndexIterator( true ); + while ( ii.more() ) { TimerHolder timer( &prefetchIndexStats); // This will page in all index pages for the given object. try { - IndexDescriptor* desc = collection->getIndexCatalog()->getDescriptor(indexNo); - verify( desc ); + IndexDescriptor* desc = ii.next(); IndexAccessMethod* iam = collection->getIndexCatalog()->getIndex( desc ); verify( iam ); iam->touch(obj); |