diff options
author | David Storch <david.storch@mongodb.com> | 2019-09-04 15:32:56 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-04 15:32:56 +0000 |
commit | b13188206e74dbeb66c4b663d83ed1d1f97c286b (patch) | |
tree | 01bcfe63112a9a4981a622a5370493d7d089a7a5 /src/mongo/db/query/stage_builder.h | |
parent | d9d50312ccdfcfb628d89f34c0dcda05c8f921bc (diff) | |
download | mongo-b13188206e74dbeb66c4b663d83ed1d1f97c286b.tar.gz |
SERVER-42852 Make PlanStage consistently hold children by unique_ptr.
Diffstat (limited to 'src/mongo/db/query/stage_builder.h')
-rw-r--r-- | src/mongo/db/query/stage_builder.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mongo/db/query/stage_builder.h b/src/mongo/db/query/stage_builder.h index 9ffceef53cf..a0437832822 100644 --- a/src/mongo/db/query/stage_builder.h +++ b/src/mongo/db/query/stage_builder.h @@ -43,21 +43,17 @@ class OperationContext; class StageBuilder { public: /** - * Turns 'solution' into an executable tree of PlanStage(s). + * Turns 'solution' into an executable tree of PlanStage(s). Returns a pointer to the root of + * the plan stage tree. * - * 'cq' must be the CanonicalQuery from which 'solution' is derived. - * - * Returns true if the PlanStage tree was built successfully. The root of the tree is in - * *rootOut and the WorkingSet that the tree uses is in wsIn. - * - * Returns false otherwise. *rootOut and *wsOut are invalid. + * 'cq' must be the CanonicalQuery from which 'solution' is derived. Illegal to call if 'wsIn' + * is nullptr, or if 'solution.root' is nullptr. */ - static bool build(OperationContext* opCtx, - const Collection* collection, - const CanonicalQuery& cq, - const QuerySolution& solution, - WorkingSet* wsIn, - PlanStage** rootOut); + static std::unique_ptr<PlanStage> build(OperationContext* opCtx, + const Collection* collection, + const CanonicalQuery& cq, + const QuerySolution& solution, + WorkingSet* wsIn); }; } // namespace mongo |