summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/delete.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-11-07 11:04:09 -0500
committerDavid Storch <david.storch@10gen.com>2018-11-12 10:29:15 -0500
commit7369fd49c9d0c348406e08a3308d6e12cdcb057a (patch)
tree4941508e4f61ea73411699161ab25f8bcb129582 /src/mongo/db/exec/delete.h
parentbc8bfc6b8ad5ebf05090ae49f8fa8bf35d028d28 (diff)
downloadmongo-7369fd49c9d0c348406e08a3308d6e12cdcb057a.tar.gz
SERVER-37446 Make UPDATE and DELETE inherit from RequiresMutableCollectionStage.
Also deletes UpdateLifecyle, which was used as part of the UpdateStage's yield recovery, but is no longer necessary.
Diffstat (limited to 'src/mongo/db/exec/delete.h')
-rw-r--r--src/mongo/db/exec/delete.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mongo/db/exec/delete.h b/src/mongo/db/exec/delete.h
index cfd65c8acec..c3fd5ee5cba 100644
--- a/src/mongo/db/exec/delete.h
+++ b/src/mongo/db/exec/delete.h
@@ -30,7 +30,7 @@
#pragma once
-#include "mongo/db/exec/plan_stage.h"
+#include "mongo/db/exec/requires_collection_stage.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/logical_session_id.h"
@@ -85,7 +85,7 @@ struct DeleteStageParams {
* Callers of work() must be holding a write lock (and, for replicated deletes, callers must have
* had the replication coordinator approve the write).
*/
-class DeleteStage final : public PlanStage {
+class DeleteStage final : public RequiresMutableCollectionStage {
MONGO_DISALLOW_COPYING(DeleteStage);
public:
@@ -98,8 +98,6 @@ public:
bool isEOF() final;
StageState doWork(WorkingSetID* out) final;
- void doRestoreState() final;
-
StageType stageType() const final {
return STAGE_DELETE;
}
@@ -117,6 +115,11 @@ public:
*/
static long long getNumDeleted(const PlanExecutor& exec);
+protected:
+ void saveState(RequiresCollTag) final {}
+
+ void restoreState(RequiresCollTag) final;
+
private:
/**
* Stores 'idToRetry' in '_idRetrying' so the delete can be retried during the next call to
@@ -129,11 +132,6 @@ private:
// Not owned by us.
WorkingSet* _ws;
- // Collection to operate on. Not owned by us. Can be NULL (if NULL, isEOF() will always
- // return true). If non-NULL, the lifetime of the collection must supersede that of the
- // stage.
- Collection* _collection;
-
// If not WorkingSet::INVALID_ID, we use this rather than asking our child what to do next.
WorkingSetID _idRetrying;