summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/queued_data_stage.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/queued_data_stage.h')
-rw-r--r--src/mongo/db/exec/queued_data_stage.h116
1 files changed, 59 insertions, 57 deletions
diff --git a/src/mongo/db/exec/queued_data_stage.h b/src/mongo/db/exec/queued_data_stage.h
index 5d7a7b2b159..89185f6d751 100644
--- a/src/mongo/db/exec/queued_data_stage.h
+++ b/src/mongo/db/exec/queued_data_stage.h
@@ -35,78 +35,80 @@
namespace mongo {
- class RecordId;
+class RecordId;
- /**
- * QueuedDataStage is a data-producing stage. Unlike the other two leaf stages (CollectionScan
- * and IndexScan) QueuedDataStage does not require any underlying storage layer.
- *
- * A QueuedDataStage is "programmed" by pushing return values from work() onto its internal
- * queue. Calls to QueuedDataStage::work() pop values off that queue and return them in FIFO
- * order, annotating the working set with data when appropriate.
- */
- class QueuedDataStage : public PlanStage {
- public:
- QueuedDataStage(WorkingSet* ws);
- virtual ~QueuedDataStage() { }
+/**
+ * QueuedDataStage is a data-producing stage. Unlike the other two leaf stages (CollectionScan
+ * and IndexScan) QueuedDataStage does not require any underlying storage layer.
+ *
+ * A QueuedDataStage is "programmed" by pushing return values from work() onto its internal
+ * queue. Calls to QueuedDataStage::work() pop values off that queue and return them in FIFO
+ * order, annotating the working set with data when appropriate.
+ */
+class QueuedDataStage : public PlanStage {
+public:
+ QueuedDataStage(WorkingSet* ws);
+ virtual ~QueuedDataStage() {}
- virtual StageState work(WorkingSetID* out);
+ virtual StageState work(WorkingSetID* out);
- virtual bool isEOF();
+ virtual bool isEOF();
- // These don't really mean anything here.
- // Some day we could count the # of calls to the yield functions to check that other stages
- // have correct yielding behavior.
- virtual void saveState();
- virtual void restoreState(OperationContext* opCtx);
- virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type);
+ // These don't really mean anything here.
+ // Some day we could count the # of calls to the yield functions to check that other stages
+ // have correct yielding behavior.
+ virtual void saveState();
+ virtual void restoreState(OperationContext* opCtx);
+ virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type);
- virtual std::vector<PlanStage*> getChildren() const;
+ virtual std::vector<PlanStage*> getChildren() const;
- virtual StageType stageType() const { return STAGE_QUEUED_DATA; }
+ virtual StageType stageType() const {
+ return STAGE_QUEUED_DATA;
+ }
- //
- // Exec stats
- //
+ //
+ // Exec stats
+ //
- virtual PlanStageStats* getStats();
+ virtual PlanStageStats* getStats();
- virtual const CommonStats* getCommonStats() const;
+ virtual const CommonStats* getCommonStats() const;
- virtual const SpecificStats* getSpecificStats() const;
+ virtual const SpecificStats* getSpecificStats() const;
- /**
- * Add a result to the back of the queue.
- *
- * Note: do not add PlanStage::ADVANCED with this method, ADVANCED can
- * only be added with a data member.
- *
- * Work() goes through the queue.
- * Either no data is returned (just a state), or...
- */
- void pushBack(const PlanStage::StageState state);
+ /**
+ * Add a result to the back of the queue.
+ *
+ * Note: do not add PlanStage::ADVANCED with this method, ADVANCED can
+ * only be added with a data member.
+ *
+ * Work() goes through the queue.
+ * Either no data is returned (just a state), or...
+ */
+ void pushBack(const PlanStage::StageState state);
- /**
- * ...data is returned (and we ADVANCED)
- *
- * Allocates a new member and copies 'member' into it.
- * Does not take ownership of anything in 'member'.
- */
- void pushBack(const WorkingSetMember& member);
+ /**
+ * ...data is returned (and we ADVANCED)
+ *
+ * Allocates a new member and copies 'member' into it.
+ * Does not take ownership of anything in 'member'.
+ */
+ void pushBack(const WorkingSetMember& member);
- static const char* kStageType;
+ static const char* kStageType;
- private:
- // We don't own this.
- WorkingSet* _ws;
+private:
+ // We don't own this.
+ WorkingSet* _ws;
- // The data we return.
- std::queue<PlanStage::StageState> _results;
- std::queue<WorkingSetID> _members;
+ // The data we return.
+ std::queue<PlanStage::StageState> _results;
+ std::queue<WorkingSetID> _members;
- // Stats
- CommonStats _commonStats;
- MockStats _specificStats;
- };
+ // Stats
+ CommonStats _commonStats;
+ MockStats _specificStats;
+};
} // namespace mongo