diff options
Diffstat (limited to 'src/mongo/db/exec/pipeline_proxy.h')
-rw-r--r-- | src/mongo/db/exec/pipeline_proxy.h | 102 |
1 files changed, 54 insertions, 48 deletions
diff --git a/src/mongo/db/exec/pipeline_proxy.h b/src/mongo/db/exec/pipeline_proxy.h index 68a33c0170e..ac501b70191 100644 --- a/src/mongo/db/exec/pipeline_proxy.h +++ b/src/mongo/db/exec/pipeline_proxy.h @@ -39,67 +39,73 @@ namespace mongo { - /** - * Stage for pulling results out from an aggregation pipeline. - */ - class PipelineProxyStage : public PlanStage { - public: - PipelineProxyStage(boost::intrusive_ptr<Pipeline> pipeline, - const std::shared_ptr<PlanExecutor>& child, - WorkingSet* ws); +/** + * Stage for pulling results out from an aggregation pipeline. + */ +class PipelineProxyStage : public PlanStage { +public: + PipelineProxyStage(boost::intrusive_ptr<Pipeline> pipeline, + const std::shared_ptr<PlanExecutor>& child, + WorkingSet* ws); - virtual PlanStage::StageState work(WorkingSetID* out); + virtual PlanStage::StageState work(WorkingSetID* out); - virtual bool isEOF(); + virtual bool isEOF(); - virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type); + virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type); - // - // Manage our OperationContext. We intentionally don't propagate to the child - // Runner as that is handled by DocumentSourceCursor as it needs to. - // - virtual void saveState(); - virtual void restoreState(OperationContext* opCtx); + // + // Manage our OperationContext. We intentionally don't propagate to the child + // Runner as that is handled by DocumentSourceCursor as it needs to. + // + virtual void saveState(); + virtual void restoreState(OperationContext* opCtx); - /** - * Make obj the next object returned by getNext(). - */ - void pushBack(const BSONObj& obj); + /** + * Make obj the next object returned by getNext(). + */ + void pushBack(const BSONObj& obj); - /** - * Return a shared pointer to the PlanExecutor that feeds the pipeline. The returned - * pointer may be NULL. - */ - std::shared_ptr<PlanExecutor> getChildExecutor(); + /** + * Return a shared pointer to the PlanExecutor that feeds the pipeline. The returned + * pointer may be NULL. + */ + std::shared_ptr<PlanExecutor> getChildExecutor(); - // Returns empty PlanStageStats object - virtual PlanStageStats* getStats(); + // Returns empty PlanStageStats object + virtual PlanStageStats* getStats(); - // Not used. - virtual CommonStats* getCommonStats() const { return NULL; } + // Not used. + virtual CommonStats* getCommonStats() const { + return NULL; + } - // Not used. - virtual SpecificStats* getSpecificStats() const { return NULL; } + // Not used. + virtual SpecificStats* getSpecificStats() const { + return NULL; + } - // Not used. - virtual std::vector<PlanStage*> getChildren() const; + // Not used. + virtual std::vector<PlanStage*> getChildren() const; - // Not used. - virtual StageType stageType() const { return STAGE_PIPELINE_PROXY; } + // Not used. + virtual StageType stageType() const { + return STAGE_PIPELINE_PROXY; + } - static const char* kStageType; + static const char* kStageType; - private: - boost::optional<BSONObj> getNextBson(); +private: + boost::optional<BSONObj> getNextBson(); - // Things in the _stash sould be returned before pulling items from _pipeline. - const boost::intrusive_ptr<Pipeline> _pipeline; - std::vector<BSONObj> _stash; - const bool _includeMetaData; - std::weak_ptr<PlanExecutor> _childExec; + // Things in the _stash sould be returned before pulling items from _pipeline. + const boost::intrusive_ptr<Pipeline> _pipeline; + std::vector<BSONObj> _stash; + const bool _includeMetaData; + std::weak_ptr<PlanExecutor> _childExec; - // Not owned by us. - WorkingSet* _ws; - }; + // Not owned by us. + WorkingSet* _ws; +}; -} // namespace mongo +} // namespace mongo |