summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2019-10-01 19:36:43 +0000
committerevergreen <evergreen@mongodb.com>2019-10-01 19:36:43 +0000
commit6d0a0e46b987dbc69a5694ff03d53d7e7e25b065 (patch)
tree65100de1652fcfebdc2569d8910972d2ae891fa4 /src/mongo/dbtests
parent0187f0fed3630b3f519daeb7290f40a92b700691 (diff)
downloadmongo-6d0a0e46b987dbc69a5694ff03d53d7e7e25b065.tar.gz
SERVER-42182 Reimplement SortStage in terms of SortExecutor.
This consolidates the implementations of DocumentSourceSort and SortStage to both use the same underlying sort execution code. It also allows a future change to expose external sort for find command (which currently requires 'enableTestCommands=true').
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/query_stage_sort.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp
index db699ced854..6332810b5cc 100644
--- a/src/mongo/dbtests/query_stage_sort.cpp
+++ b/src/mongo/dbtests/query_stage_sort.cpp
@@ -120,8 +120,12 @@ public:
auto keyGenStage = std::make_unique<SortKeyGeneratorStage>(
_expCtx, std::move(queuedDataStage), ws.get(), sortPattern);
- auto ss = std::make_unique<SortStage>(
- _expCtx, ws.get(), sortPattern, limit(), maxMemoryUsageBytes(), std::move(keyGenStage));
+ auto ss = std::make_unique<SortStage>(_expCtx,
+ ws.get(),
+ SortPattern{sortPattern, _expCtx},
+ limit(),
+ maxMemoryUsageBytes(),
+ std::move(keyGenStage));
// The PlanExecutor will be automatically registered on construction due to the auto
// yield policy, so it can receive invalidations when we remove documents later.
@@ -156,8 +160,12 @@ public:
auto keyGenStage = std::make_unique<SortKeyGeneratorStage>(
_expCtx, std::move(queuedDataStage), ws.get(), sortPattern);
- auto sortStage = std::make_unique<SortStage>(
- _expCtx, ws.get(), sortPattern, limit(), maxMemoryUsageBytes(), std::move(keyGenStage));
+ auto sortStage = std::make_unique<SortStage>(_expCtx,
+ ws.get(),
+ SortPattern{sortPattern, _expCtx},
+ limit(),
+ maxMemoryUsageBytes(),
+ std::move(keyGenStage));
auto fetchStage =
std::make_unique<FetchStage>(&_opCtx, ws.get(), std::move(sortStage), nullptr, coll);
@@ -560,8 +568,12 @@ public:
auto keyGenStage = std::make_unique<SortKeyGeneratorStage>(
_expCtx, std::move(queuedDataStage), ws.get(), sortPattern);
- auto sortStage = std::make_unique<SortStage>(
- _expCtx, ws.get(), sortPattern, 0u, maxMemoryUsageBytes(), std::move(keyGenStage));
+ auto sortStage = std::make_unique<SortStage>(_expCtx,
+ ws.get(),
+ SortPattern{sortPattern, _expCtx},
+ 0u,
+ maxMemoryUsageBytes(),
+ std::move(keyGenStage));
auto fetchStage =
std::make_unique<FetchStage>(&_opCtx, ws.get(), std::move(sortStage), nullptr, coll);