diff options
author | Martin Neupauer <martin.neupauer@mongodb.com> | 2020-06-11 08:07:39 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-11 11:17:49 +0000 |
commit | e3948d4d8817579b6b03618e64e1b9e8cc2ef086 (patch) | |
tree | 649bef264a16807b269f7b645a8d2312c4442455 /src/mongo/dbtests/query_plan_executor.cpp | |
parent | 0af9c85d7e2ba60f592f2d7a9a35217e254e59fb (diff) | |
download | mongo-e3948d4d8817579b6b03618e64e1b9e8cc2ef086.tar.gz |
SERVER-48228 Move slot-based execution engine and supporting changes into the master branch
This is an initial commit for the slot-based execution engine (SBE) which contains:
* Implementation of the core slot-based engine.
* The SBE stage builder, which is responsible for translating a QuerySolution tree
into an SBE plan.
* Other changes necessary for integration with the find command.
Co-authored-by: Anton Korshunov <anton.korshunov@mongodb.com>
Co-authored-by: Justin Seyster <justin.seyster@mongodb.com>
Co-authored-by: David Storch <david.storch@mongodb.com>
Diffstat (limited to 'src/mongo/dbtests/query_plan_executor.cpp')
-rw-r--r-- | src/mongo/dbtests/query_plan_executor.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp index 529a572097f..10961cb1018 100644 --- a/src/mongo/dbtests/query_plan_executor.cpp +++ b/src/mongo/dbtests/query_plan_executor.cpp @@ -99,7 +99,7 @@ public: unique_ptr<PlanExecutor, PlanExecutor::Deleter> makeCollScanExec( Collection* coll, BSONObj& filterObj, - PlanExecutor::YieldPolicy yieldPolicy = PlanExecutor::YieldPolicy::YIELD_MANUAL, + PlanYieldPolicy::YieldPolicy yieldPolicy = PlanYieldPolicy::YieldPolicy::YIELD_MANUAL, TailableModeEnum tailableMode = TailableModeEnum::kNormal) { CollectionScanParams csparams; csparams.direction = CollectionScanParams::FORWARD; @@ -164,8 +164,12 @@ public: verify(nullptr != cq.get()); // Hand the plan off to the executor. - auto statusWithPlanExecutor = PlanExecutor::make( - std::move(cq), std::move(ws), std::move(root), coll, PlanExecutor::YIELD_MANUAL); + auto statusWithPlanExecutor = + PlanExecutor::make(std::move(cq), + std::move(ws), + std::move(root), + coll, + PlanYieldPolicy::YieldPolicy::YIELD_MANUAL); ASSERT_OK(statusWithPlanExecutor.getStatus()); return std::move(statusWithPlanExecutor.getValue()); } @@ -223,8 +227,11 @@ TEST_F(PlanExecutorTest, DropIndexScanAgg) { auto ws = std::make_unique<WorkingSet>(); auto proxy = std::make_unique<PipelineProxyStage>(_expCtx.get(), std::move(pipeline), ws.get()); - auto statusWithPlanExecutor = PlanExecutor::make( - _expCtx, std::move(ws), std::move(proxy), collection, PlanExecutor::NO_YIELD); + auto statusWithPlanExecutor = PlanExecutor::make(_expCtx, + std::move(ws), + std::move(proxy), + collection, + PlanYieldPolicy::YieldPolicy::NO_YIELD); ASSERT_OK(statusWithPlanExecutor.getStatus()); auto outerExec = std::move(statusWithPlanExecutor.getValue()); @@ -245,7 +252,7 @@ TEST_F(PlanExecutorTest, ShouldReportErrorIfExceedsTimeLimitDuringYield) { BSONObj filterObj = fromjson("{_id: {$gt: 0}}"); Collection* coll = ctx.getCollection(); - auto exec = makeCollScanExec(coll, filterObj, PlanExecutor::YieldPolicy::ALWAYS_TIME_OUT); + auto exec = makeCollScanExec(coll, filterObj, PlanYieldPolicy::YieldPolicy::ALWAYS_TIME_OUT); BSONObj resultObj; ASSERT_THROWS_CODE_AND_WHAT(exec->getNext(&resultObj, nullptr), @@ -264,7 +271,7 @@ TEST_F(PlanExecutorTest, ShouldReportErrorIfKilledDuringYieldButIsTailableAndAwa Collection* coll = ctx.getCollection(); auto exec = makeCollScanExec(coll, filterObj, - PlanExecutor::YieldPolicy::ALWAYS_TIME_OUT, + PlanYieldPolicy::YieldPolicy::ALWAYS_TIME_OUT, TailableModeEnum::kTailableAndAwaitData); BSONObj resultObj; @@ -282,8 +289,10 @@ TEST_F(PlanExecutorTest, ShouldNotSwallowExceedsTimeLimitDuringYieldButIsTailabl BSONObj filterObj = fromjson("{_id: {$gt: 0}}"); Collection* coll = ctx.getCollection(); - auto exec = makeCollScanExec( - coll, filterObj, PlanExecutor::YieldPolicy::ALWAYS_TIME_OUT, TailableModeEnum::kTailable); + auto exec = makeCollScanExec(coll, + filterObj, + PlanYieldPolicy::YieldPolicy::ALWAYS_TIME_OUT, + TailableModeEnum::kTailable); BSONObj resultObj; ASSERT_THROWS_CODE_AND_WHAT(exec->getNext(&resultObj, nullptr), @@ -300,7 +309,7 @@ TEST_F(PlanExecutorTest, ShouldReportErrorIfKilledDuringYield) { BSONObj filterObj = fromjson("{_id: {$gt: 0}}"); Collection* coll = ctx.getCollection(); - auto exec = makeCollScanExec(coll, filterObj, PlanExecutor::YieldPolicy::ALWAYS_MARK_KILLED); + auto exec = makeCollScanExec(coll, filterObj, PlanYieldPolicy::YieldPolicy::ALWAYS_MARK_KILLED); BSONObj resultObj; ASSERT_THROWS_CODE_AND_WHAT(exec->getNext(&resultObj, nullptr), |