summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/multi_iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/multi_iterator.h')
-rw-r--r--src/mongo/db/exec/multi_iterator.h86
1 files changed, 46 insertions, 40 deletions
diff --git a/src/mongo/db/exec/multi_iterator.h b/src/mongo/db/exec/multi_iterator.h
index ac2cf44b007..ada4bc16c9a 100644
--- a/src/mongo/db/exec/multi_iterator.h
+++ b/src/mongo/db/exec/multi_iterator.h
@@ -38,60 +38,66 @@
namespace mongo {
- /**
- * Iterates over a collection using multiple underlying RecordCursors.
- *
- * This is a special stage which is not used automatically by queries. It is intended for
- * special commands that work with RecordCursors. For example, it is used by the
- * parallelCollectionScan and repairCursor commands
- */
- class MultiIteratorStage : public PlanStage {
- public:
- MultiIteratorStage(OperationContext* txn, WorkingSet* ws, Collection* collection);
+/**
+ * Iterates over a collection using multiple underlying RecordCursors.
+ *
+ * This is a special stage which is not used automatically by queries. It is intended for
+ * special commands that work with RecordCursors. For example, it is used by the
+ * parallelCollectionScan and repairCursor commands
+ */
+class MultiIteratorStage : public PlanStage {
+public:
+ MultiIteratorStage(OperationContext* txn, WorkingSet* ws, Collection* collection);
- ~MultiIteratorStage() { }
+ ~MultiIteratorStage() {}
- void addIterator(std::unique_ptr<RecordCursor> it);
+ void addIterator(std::unique_ptr<RecordCursor> it);
- virtual PlanStage::StageState work(WorkingSetID* out);
+ virtual PlanStage::StageState work(WorkingSetID* out);
- virtual bool isEOF();
+ virtual bool isEOF();
- void kill();
+ void kill();
- virtual void saveState();
- virtual void restoreState(OperationContext* opCtx);
+ virtual void saveState();
+ virtual void restoreState(OperationContext* opCtx);
- virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type);
+ virtual void invalidate(OperationContext* txn, const RecordId& dl, InvalidationType type);
- // 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_MULTI_ITERATOR; }
+ // Not used.
+ virtual StageType stageType() const {
+ return STAGE_MULTI_ITERATOR;
+ }
- static const char* kStageType;
+ static const char* kStageType;
- private:
- OperationContext* _txn;
- Collection* _collection;
- std::vector<std::unique_ptr<RecordCursor>> _iterators;
+private:
+ OperationContext* _txn;
+ Collection* _collection;
+ std::vector<std::unique_ptr<RecordCursor>> _iterators;
- // Not owned by us.
- WorkingSet* _ws;
+ // Not owned by us.
+ WorkingSet* _ws;
- // We allocate a working set member with this id on construction of the stage. It gets
- // used for all fetch requests, changing the RecordId as appropriate.
- const WorkingSetID _wsidForFetch;
- };
+ // We allocate a working set member with this id on construction of the stage. It gets
+ // used for all fetch requests, changing the RecordId as appropriate.
+ const WorkingSetID _wsidForFetch;
+};
-} // namespace mongo
+} // namespace mongo