diff options
author | Mathias Stearn <mathias@10gen.com> | 2013-08-30 17:55:58 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2013-09-20 15:46:19 -0400 |
commit | 755e7956642c01d2ba6ae7cf184b0f1a8aa0eab1 (patch) | |
tree | ca054dbd79b8db197cd7c5a6852dcffbdfea9c56 /src/mongo/db/pipeline/pipeline.h | |
parent | 2616160bb68adc7748587100c52216edee60d6fc (diff) | |
download | mongo-755e7956642c01d2ba6ae7cf184b0f1a8aa0eab1.tar.gz |
SERVER-4504 explain for aggregation
This is just the infrastucture change. Each DocumentSource will need to
have it's serialize()/serializeToArray() implementation examined and
improved.
Related tickets:
SERVER-6140 A specific failure in the old impl of explain.
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.h')
-rw-r--r-- | src/mongo/db/pipeline/pipeline.h | 59 |
1 files changed, 7 insertions, 52 deletions
diff --git a/src/mongo/db/pipeline/pipeline.h b/src/mongo/db/pipeline/pipeline.h index 704d5027d0d..ac28c3084ad 100644 --- a/src/mongo/db/pipeline/pipeline.h +++ b/src/mongo/db/pipeline/pipeline.h @@ -118,12 +118,7 @@ namespace mongo { */ void run(BSONObjBuilder& result); - /** - Ask if this is for an explain request. - - @returns true if this is an explain - */ - bool isExplain() const; + bool isExplain() const { return explain; } /// The initial source is special since it varies between mongos and mongod. void addInitialSource(intrusive_ptr<DocumentSource> source); @@ -135,6 +130,12 @@ namespace mongo { bool canRunInMongos() const; /** + * Write the pipeline's operators to a vector<Value>, with the + * explain flag true (for DocumentSource::serializeToArray()). + */ + vector<Value> writeExplainOps() const; + + /** The aggregation command name. */ static const char commandName[]; @@ -159,39 +160,6 @@ namespace mongo { Pipeline(const intrusive_ptr<ExpressionContext> &pCtx); - /** - * Write the pipeline's operators to a vector<Value>, with the - * explain flag true (for DocumentSource::serializeToArray()). - */ - vector<Value> writeExplainOps() const; - - /* - Write the pipeline's operators to the given result document, - for a shard server (or regular server, in an unsharded setup). - - This uses writeExplainOps() and adds that array to the result - with the serverPipelineName. That will be preceded by explain - information for the input source. - - @param result the object to add the explain information to - */ - void writeExplainShard(BSONObjBuilder &result) const; - - /* - Write the pipeline's operators to the given result document, - for a mongos instance. - - This first adds the serverPipeline obtained from the input - source. - - Then this uses writeExplainOps() and adds that array to the result - with the serverPipelineName. That will be preceded by explain - information for the input source. - - @param result the object to add the explain information to - */ - void writeExplainMongos(BSONObjBuilder &result) const; - typedef std::deque<boost::intrusive_ptr<DocumentSource> > SourceContainer; SourceContainer sources; bool explain; @@ -200,16 +168,3 @@ namespace mongo { }; } // namespace mongo - - -/* ======================= INLINED IMPLEMENTATIONS ========================== */ - -namespace mongo { - - inline bool Pipeline::isExplain() const { - return explain; - } - -} // namespace mongo - - |