diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-01-24 15:47:07 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-01-24 15:47:07 -0500 |
commit | 7349ba70a0e68627dc322113c561afe3a9ed37a1 (patch) | |
tree | afe597cf004f191288999d8efad785b42833809d /src/mongo/db/query/internal_plans.h | |
parent | ed58b0dfe564253067b4cab11ab75477b7e48388 (diff) | |
download | mongo-7349ba70a0e68627dc322113c561afe3a9ed37a1.tar.gz |
SERVER-12392: Move cursor/runner cache into Collection lifecycle via CollectionCursorCache
Diffstat (limited to 'src/mongo/db/query/internal_plans.h')
-rw-r--r-- | src/mongo/db/query/internal_plans.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/db/query/internal_plans.h b/src/mongo/db/query/internal_plans.h index be09789d8bb..fa5597dfbc1 100644 --- a/src/mongo/db/query/internal_plans.h +++ b/src/mongo/db/query/internal_plans.h @@ -62,7 +62,7 @@ namespace mongo { /** * Return a collection scan. Caller owns pointer. */ - static Runner* collectionScan(const StringData& ns, + static Runner* collectionScan(const StringData& ns, // TODO: make this a Collection* const Direction direction = FORWARD, const DiskLoc startLoc = DiskLoc()) { Collection* collection = cc().database()->getCollection(ns); @@ -81,7 +81,7 @@ namespace mongo { WorkingSet* ws = new WorkingSet(); CollectionScan* cs = new CollectionScan(params, ws, NULL); - return new InternalRunner(ns.toString(), cs, ws); + return new InternalRunner(collection, cs, ws); } /** @@ -92,9 +92,8 @@ namespace mongo { const BSONObj& startKey, const BSONObj& endKey, bool endKeyInclusive, Direction direction = FORWARD, int options = 0) { - verify(descriptor); - - const NamespaceString& ns = collection->ns(); + invariant(collection); + invariant(descriptor); IndexScanParams params; params.descriptor = descriptor; @@ -108,10 +107,10 @@ namespace mongo { IndexScan* ix = new IndexScan(params, ws, NULL); if (IXSCAN_FETCH & options) { - return new InternalRunner(ns.toString(), new FetchStage(ws, ix, NULL), ws); + return new InternalRunner(collection, new FetchStage(ws, ix, NULL), ws); } else { - return new InternalRunner(ns.toString(), ix, ws); + return new InternalRunner(collection, ix, ws); } } }; |