summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/stage_builder.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2019-09-04 15:32:56 +0000
committerevergreen <evergreen@mongodb.com>2019-09-04 15:32:56 +0000
commitb13188206e74dbeb66c4b663d83ed1d1f97c286b (patch)
tree01bcfe63112a9a4981a622a5370493d7d089a7a5 /src/mongo/db/query/stage_builder.h
parentd9d50312ccdfcfb628d89f34c0dcda05c8f921bc (diff)
downloadmongo-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.h22
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