diff options
Diffstat (limited to 'src/mongo/db/exec/shard_filter.cpp')
-rw-r--r-- | src/mongo/db/exec/shard_filter.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp index 26fe05144dd..1339e13bd3e 100644 --- a/src/mongo/db/exec/shard_filter.cpp +++ b/src/mongo/db/exec/shard_filter.cpp @@ -53,12 +53,14 @@ const char* ShardFilterStage::kStageType = "SHARDING_FILTER"; ShardFilterStage::ShardFilterStage(const shared_ptr<CollectionMetadata>& metadata, WorkingSet* ws, PlanStage* child) - : _ws(ws), _child(child), _commonStats(kStageType), _metadata(metadata) {} + : PlanStage(kStageType), _ws(ws), _metadata(metadata) { + _children.emplace_back(child); +} ShardFilterStage::~ShardFilterStage() {} bool ShardFilterStage::isEOF() { - return _child->isEOF(); + return child()->isEOF(); } PlanStage::StageState ShardFilterStage::work(WorkingSetID* out) { @@ -72,7 +74,7 @@ PlanStage::StageState ShardFilterStage::work(WorkingSetID* out) { return PlanStage::IS_EOF; } - StageState status = _child->work(out); + StageState status = child()->work(out); if (PlanStage::ADVANCED == status) { // If we're sharded make sure that we don't return data that is not owned by us, @@ -129,42 +131,15 @@ PlanStage::StageState ShardFilterStage::work(WorkingSetID* out) { return status; } -void ShardFilterStage::saveState() { - ++_commonStats.yields; - _child->saveState(); -} - -void ShardFilterStage::restoreState(OperationContext* opCtx) { - ++_commonStats.unyields; - _child->restoreState(opCtx); -} - -void ShardFilterStage::invalidate(OperationContext* txn, - const RecordId& dl, - InvalidationType type) { - ++_commonStats.invalidates; - _child->invalidate(txn, dl, type); -} - -vector<PlanStage*> ShardFilterStage::getChildren() const { - vector<PlanStage*> children; - children.push_back(_child.get()); - return children; -} - unique_ptr<PlanStageStats> ShardFilterStage::getStats() { _commonStats.isEOF = isEOF(); unique_ptr<PlanStageStats> ret = make_unique<PlanStageStats>(_commonStats, STAGE_SHARDING_FILTER); - ret->children.push_back(_child->getStats().release()); + ret->children.push_back(child()->getStats().release()); ret->specific = make_unique<ShardingFilterStats>(_specificStats); return ret; } -const CommonStats* ShardFilterStage::getCommonStats() const { - return &_commonStats; -} - const SpecificStats* ShardFilterStage::getSpecificStats() const { return &_specificStats; } |