summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/pipeline.h
diff options
context:
space:
mode:
authorBenjamin Murphy <benjamin_murphy@me.com>2016-01-29 13:27:59 -0500
committerBenjamin Murphy <benjamin_murphy@me.com>2016-02-11 10:15:58 -0500
commit34ae8f620cda69798230cf3d9e3986e79580fa6f (patch)
tree23a1c754c25f68333918f23cb8480fe3b780a4c9 /src/mongo/db/pipeline/pipeline.h
parent5495e297c683a92da95cd6a6420dde99ad751df7 (diff)
downloadmongo-34ae8f620cda69798230cf3d9e3986e79580fa6f.tar.gz
SERVER-19542 Refactored pipeline optimization.
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.h')
-rw-r--r--src/mongo/db/pipeline/pipeline.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/pipeline.h b/src/mongo/db/pipeline/pipeline.h
index 65ff1ad97e9..431933e159e 100644
--- a/src/mongo/db/pipeline/pipeline.h
+++ b/src/mongo/db/pipeline/pipeline.h
@@ -52,6 +52,8 @@ class Privilege;
*/
class Pipeline : public IntrusiveCounterUnsigned {
public:
+ typedef std::list<boost::intrusive_ptr<DocumentSource>> SourceContainer;
+
/**
* Create a pipeline from the command.
*
@@ -64,7 +66,7 @@ public:
const BSONObj& cmdObj,
const boost::intrusive_ptr<ExpressionContext>& pCtx);
- /// Helper to implement Command::checkAuthForCommand
+ // Helper to implement Command::checkAuthForCommand
static Status checkAuthForCommand(ClientBasic* client,
const std::string& dbname,
const BSONObj& cmdObj);
@@ -95,6 +97,11 @@ public:
bool needsPrimaryShardMerger() const;
/**
+ * Modifies the pipeline, optimizing it by combining and swapping stages.
+ */
+ void optimizePipeline();
+
+ /**
* Returns any other collections involved in the pipeline in addition to the collection the
* aggregation is run on.
*/
@@ -189,7 +196,6 @@ private:
Pipeline(const boost::intrusive_ptr<ExpressionContext>& pCtx);
- typedef std::deque<boost::intrusive_ptr<DocumentSource>> SourceContainer;
SourceContainer sources;
bool explain;