diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2013-04-18 17:10:12 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2013-04-19 12:02:28 -0400 |
commit | f75c238b3363048f91ed22d9db0cb83383b1ebd4 (patch) | |
tree | 69ba4f02340ef077bf3ad522e26a23002d7a2d1f /src/mongo/db/prefetch.cpp | |
parent | 89ca7f9d6f134e09241837edeb9b456d80f2abc9 (diff) | |
download | mongo-f75c238b3363048f91ed22d9db0cb83383b1ebd4.tar.gz |
SERVER-8791 SERVER-9165 SERVER-9212 move build into own class, clean up getKeys calls
Diffstat (limited to 'src/mongo/db/prefetch.cpp')
-rw-r--r-- | src/mongo/db/prefetch.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp index 73bc3047757..fb345ae443d 100644 --- a/src/mongo/db/prefetch.cpp +++ b/src/mongo/db/prefetch.cpp @@ -20,6 +20,7 @@ #include "mongo/db/dbhelpers.h" #include "mongo/db/diskloc.h" +#include "mongo/db/index/catalog_hack.h" #include "mongo/db/index.h" #include "mongo/db/index_update.h" #include "mongo/db/jsobj.h" @@ -103,7 +104,6 @@ namespace mongo { void prefetchIndexPages(NamespaceDetails *nsd, const BSONObj& obj) { DiskLoc unusedDl; // unused - IndexInterface::IndexInserter inserter; BSONObjSet unusedKeys; ReplSetImpl::IndexPrefetchConfig prefetchConfig = theReplSet->getIndexPrefetchConfig(); @@ -121,13 +121,9 @@ namespace mongo { int indexNo = nsd->findIdIndex(); if (indexNo == -1) return; try { - fetchIndexInserters(/*out*/unusedKeys, - inserter, - nsd, - indexNo, - obj, - unusedDl, - /*allowDups*/true); + auto_ptr<IndexDescriptor> desc(CatalogHack::getDescriptor(nsd, indexNo)); + auto_ptr<IndexAccessMethod> iam(CatalogHack::getIndex(desc.get())); + iam->touch(obj); } catch (const DBException& e) { LOG(2) << "ignoring exception in prefetchIndexPages(): " << e.what() << endl; @@ -143,13 +139,9 @@ namespace mongo { TimerHolder timer( &prefetchIndexStats); // This will page in all index pages for the given object. try { - fetchIndexInserters(/*out*/unusedKeys, - inserter, - nsd, - indexNo, - obj, - unusedDl, - /*allowDups*/true); + auto_ptr<IndexDescriptor> desc(CatalogHack::getDescriptor(nsd, indexNo)); + auto_ptr<IndexAccessMethod> iam(CatalogHack::getIndex(desc.get())); + iam->touch(obj); } catch (const DBException& e) { LOG(2) << "ignoring exception in prefetchIndexPages(): " << e.what() << endl; |