summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-04-11 16:28:24 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-04-11 16:28:24 -0400
commit3b41d489010fec3502bd18e1092bb3f325813456 (patch)
tree6f2c69e49c6e61eba7583febab61579d95cc6bb2 /src/mongo/db/pipeline
parentb829abf80b7e4f8512a3e69935e351724cba4a74 (diff)
downloadmongo-3b41d489010fec3502bd18e1092bb3f325813456.tar.gz
Revert "SERVER-39403 Implement visitor for DocumentSource as precursor work for"
This reverts commit 1b00abfda7592d701f632b9550f973c56cea818f.
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source.h7
-rw-r--r--src/mongo/db/pipeline/document_source_bucket_auto.h4
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream.h4
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream_close_cursor.h4
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream_transform.h4
-rw-r--r--src/mongo/db/pipeline/document_source_check_invalidate.h4
-rw-r--r--src/mongo/db/pipeline/document_source_check_resume_token.h8
-rw-r--r--src/mongo/db/pipeline/document_source_coll_stats.h4
-rw-r--r--src/mongo/db/pipeline/document_source_current_op.h4
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.h4
-rw-r--r--src/mongo/db/pipeline/document_source_exchange.h4
-rw-r--r--src/mongo/db/pipeline/document_source_facet.h4
-rw-r--r--src/mongo/db/pipeline/document_source_geo_near.h3
-rw-r--r--src/mongo/db/pipeline/document_source_graph_lookup.h4
-rw-r--r--src/mongo/db/pipeline/document_source_group.h4
-rw-r--r--src/mongo/db/pipeline/document_source_index_stats.h4
-rw-r--r--src/mongo/db/pipeline/document_source_internal_inhibit_optimization.h4
-rw-r--r--src/mongo/db/pipeline/document_source_internal_split_pipeline.h4
-rw-r--r--src/mongo/db/pipeline/document_source_limit.h4
-rw-r--r--src/mongo/db/pipeline/document_source_list_cached_and_active_users.h4
-rw-r--r--src/mongo/db/pipeline/document_source_list_local_sessions.h4
-rw-r--r--src/mongo/db/pipeline/document_source_list_sessions.h4
-rw-r--r--src/mongo/db/pipeline/document_source_lookup.h4
-rw-r--r--src/mongo/db/pipeline/document_source_lookup_change_post_image.h4
-rw-r--r--src/mongo/db/pipeline/document_source_match.h4
-rw-r--r--src/mongo/db/pipeline/document_source_mock.h4
-rw-r--r--src/mongo/db/pipeline/document_source_out.h4
-rw-r--r--src/mongo/db/pipeline/document_source_plan_cache_stats.h4
-rw-r--r--src/mongo/db/pipeline/document_source_redact.h4
-rw-r--r--src/mongo/db/pipeline/document_source_sample.h4
-rw-r--r--src/mongo/db/pipeline/document_source_sample_from_random_cursor.h4
-rw-r--r--src/mongo/db/pipeline/document_source_sequential_document_cache.h4
-rw-r--r--src/mongo/db/pipeline/document_source_single_document_transformation.h4
-rw-r--r--src/mongo/db/pipeline/document_source_skip.h4
-rw-r--r--src/mongo/db/pipeline/document_source_sort.h4
-rw-r--r--src/mongo/db/pipeline/document_source_tee_consumer.h4
-rw-r--r--src/mongo/db/pipeline/document_source_test_optimizations.h4
-rw-r--r--src/mongo/db/pipeline/document_source_unwind.h4
-rw-r--r--src/mongo/db/pipeline/document_source_visitor.h133
39 files changed, 0 insertions, 291 deletions
diff --git a/src/mongo/db/pipeline/document_source.h b/src/mongo/db/pipeline/document_source.h
index de0ef8b209d..f3f67db8e0a 100644
--- a/src/mongo/db/pipeline/document_source.h
+++ b/src/mongo/db/pipeline/document_source.h
@@ -47,7 +47,6 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/pipeline/dependencies.h"
#include "mongo/db/pipeline/document.h"
-#include "mongo/db/pipeline/document_source_visitor.h"
#include "mongo/db/pipeline/expression_context.h"
#include "mongo/db/pipeline/field_path.h"
#include "mongo/db/pipeline/lite_parsed_document_source.h"
@@ -469,12 +468,6 @@ public:
return false;
}
- /**
- * This allows an arbitrary class to implement logic which gets dispatched to at runtime
- * depending on the type of the DocumentSource.
- */
- virtual void acceptVisitor(DocumentSourceVisitor* visitor) = 0;
-
protected:
explicit DocumentSource(const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
diff --git a/src/mongo/db/pipeline/document_source_bucket_auto.h b/src/mongo/db/pipeline/document_source_bucket_auto.h
index 0ccb3981a13..961ad0f9865 100644
--- a/src/mongo/db/pipeline/document_source_bucket_auto.h
+++ b/src/mongo/db/pipeline/document_source_bucket_auto.h
@@ -88,10 +88,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_change_stream.h b/src/mongo/db/pipeline/document_source_change_stream.h
index c6ddf3c67c3..077ec7ff616 100644
--- a/src/mongo/db/pipeline/document_source_change_stream.h
+++ b/src/mongo/db/pipeline/document_source_change_stream.h
@@ -230,10 +230,6 @@ public:
Value serialize(boost::optional<ExplainOptions::Verbosity> explain) const final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceOplogMatch(BSONObj filter, const boost::intrusive_ptr<ExpressionContext>& expCtx);
};
diff --git a/src/mongo/db/pipeline/document_source_change_stream_close_cursor.h b/src/mongo/db/pipeline/document_source_change_stream_close_cursor.h
index b19f6861495..d21a2170157 100644
--- a/src/mongo/db/pipeline/document_source_change_stream_close_cursor.h
+++ b/src/mongo/db/pipeline/document_source_change_stream_close_cursor.h
@@ -82,10 +82,6 @@ public:
return MergingLogic{nullptr, this, change_stream_constants::kSortSpec};
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
/**
* Use the create static method to create a DocumentSourceCloseCursor.
diff --git a/src/mongo/db/pipeline/document_source_change_stream_transform.h b/src/mongo/db/pipeline/document_source_change_stream_transform.h
index 425995498aa..ca1003128fd 100644
--- a/src/mongo/db/pipeline/document_source_change_stream_transform.h
+++ b/src/mongo/db/pipeline/document_source_change_stream_transform.h
@@ -63,10 +63,6 @@ public:
return DocumentSourceChangeStream::kStageName.rawData();
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
// This constructor is private, callers should use the 'create()' method above.
DocumentSourceChangeStreamTransform(const boost::intrusive_ptr<ExpressionContext>&,
diff --git a/src/mongo/db/pipeline/document_source_check_invalidate.h b/src/mongo/db/pipeline/document_source_check_invalidate.h
index 2870bccc7f5..5e5b14f69af 100644
--- a/src/mongo/db/pipeline/document_source_check_invalidate.h
+++ b/src/mongo/db/pipeline/document_source_check_invalidate.h
@@ -72,10 +72,6 @@ public:
return new DocumentSourceCheckInvalidate(expCtx, ignoreFirstInvalidate);
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
/**
* Use the create static method to create a DocumentSourceCheckInvalidate.
diff --git a/src/mongo/db/pipeline/document_source_check_resume_token.h b/src/mongo/db/pipeline/document_source_check_resume_token.h
index 0a6d4b5e724..c91c9813157 100644
--- a/src/mongo/db/pipeline/document_source_check_resume_token.h
+++ b/src/mongo/db/pipeline/document_source_check_resume_token.h
@@ -84,10 +84,6 @@ public:
static boost::intrusive_ptr<DocumentSourceShardCheckResumability> create(
const boost::intrusive_ptr<ExpressionContext>& expCtx, ResumeTokenData token);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
/**
* Use the create static method to create a DocumentSourceShardCheckResumability.
@@ -149,10 +145,6 @@ public:
static boost::intrusive_ptr<DocumentSourceEnsureResumeTokenPresent> create(
const boost::intrusive_ptr<ExpressionContext>& expCtx, ResumeTokenData token);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
/**
* Use the create static method to create a DocumentSourceEnsureResumeTokenPresent.
diff --git a/src/mongo/db/pipeline/document_source_coll_stats.h b/src/mongo/db/pipeline/document_source_coll_stats.h
index b9d4d8e8f3d..8cea821a23a 100644
--- a/src/mongo/db/pipeline/document_source_coll_stats.h
+++ b/src/mongo/db/pipeline/document_source_coll_stats.h
@@ -96,10 +96,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
// The raw object given to $collStats containing user specified options.
BSONObj _collStatsSpec;
diff --git a/src/mongo/db/pipeline/document_source_current_op.h b/src/mongo/db/pipeline/document_source_current_op.h
index 68f8493e290..84340c63e71 100644
--- a/src/mongo/db/pipeline/document_source_current_op.h
+++ b/src/mongo/db/pipeline/document_source_current_op.h
@@ -133,10 +133,6 @@ public:
Value serialize(boost::optional<ExplainOptions::Verbosity> explain = boost::none) const final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceCurrentOp(const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
ConnMode includeIdleConnections,
diff --git a/src/mongo/db/pipeline/document_source_cursor.h b/src/mongo/db/pipeline/document_source_cursor.h
index 94e34fed1f5..d1ca145b886 100644
--- a/src/mongo/db/pipeline/document_source_cursor.h
+++ b/src/mongo/db/pipeline/document_source_cursor.h
@@ -151,10 +151,6 @@ public:
return _planSummaryStats;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
DocumentSourceCursor(Collection* collection,
std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> exec,
diff --git a/src/mongo/db/pipeline/document_source_exchange.h b/src/mongo/db/pipeline/document_source_exchange.h
index 1c4624f78a4..4b6b821be82 100644
--- a/src/mongo/db/pipeline/document_source_exchange.h
+++ b/src/mongo/db/pipeline/document_source_exchange.h
@@ -247,10 +247,6 @@ public:
return _consumerId;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
boost::intrusive_ptr<Exchange> _exchange;
diff --git a/src/mongo/db/pipeline/document_source_facet.h b/src/mongo/db/pipeline/document_source_facet.h
index 8dfe289e37d..74281663fb6 100644
--- a/src/mongo/db/pipeline/document_source_facet.h
+++ b/src/mongo/db/pipeline/document_source_facet.h
@@ -145,10 +145,6 @@ public:
StageConstraints constraints(Pipeline::SplitState pipeState) const final;
bool usedDisk() final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_geo_near.h b/src/mongo/db/pipeline/document_source_geo_near.h
index c9b50d6f586..749d9fee7cd 100644
--- a/src/mongo/db/pipeline/document_source_geo_near.h
+++ b/src/mongo/db/pipeline/document_source_geo_near.h
@@ -125,9 +125,6 @@ public:
*/
boost::optional<MergingLogic> mergingLogic() final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
private:
explicit DocumentSourceGeoNear(const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
diff --git a/src/mongo/db/pipeline/document_source_graph_lookup.h b/src/mongo/db/pipeline/document_source_graph_lookup.h
index 2df71c08e72..6449560875b 100644
--- a/src/mongo/db/pipeline/document_source_graph_lookup.h
+++ b/src/mongo/db/pipeline/document_source_graph_lookup.h
@@ -105,10 +105,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_group.h b/src/mongo/db/pipeline/document_source_group.h
index f65754ab7f5..b166d8e8335 100644
--- a/src/mongo/db/pipeline/document_source_group.h
+++ b/src/mongo/db/pipeline/document_source_group.h
@@ -172,10 +172,6 @@ public:
std::unique_ptr<GroupFromFirstDocumentTransformation> rewriteGroupAsTransformOnFirstDocument()
const;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_index_stats.h b/src/mongo/db/pipeline/document_source_index_stats.h
index e4a3b30292e..9b162ca4575 100644
--- a/src/mongo/db/pipeline/document_source_index_stats.h
+++ b/src/mongo/db/pipeline/document_source_index_stats.h
@@ -89,10 +89,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceIndexStats(const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
diff --git a/src/mongo/db/pipeline/document_source_internal_inhibit_optimization.h b/src/mongo/db/pipeline/document_source_internal_inhibit_optimization.h
index ce99d887aed..209c39308b8 100644
--- a/src/mongo/db/pipeline/document_source_internal_inhibit_optimization.h
+++ b/src/mongo/db/pipeline/document_source_internal_inhibit_optimization.h
@@ -68,10 +68,6 @@ public:
GetNextResult getNext() final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
Value serialize(boost::optional<ExplainOptions::Verbosity> explain = boost::none) const final;
};
diff --git a/src/mongo/db/pipeline/document_source_internal_split_pipeline.h b/src/mongo/db/pipeline/document_source_internal_split_pipeline.h
index 9ed1ff52741..b2b30952dd2 100644
--- a/src/mongo/db/pipeline/document_source_internal_split_pipeline.h
+++ b/src/mongo/db/pipeline/document_source_internal_split_pipeline.h
@@ -74,10 +74,6 @@ public:
GetNextResult getNext() final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceInternalSplitPipeline(const boost::intrusive_ptr<ExpressionContext>& expCtx,
HostTypeRequirement mergeType)
diff --git a/src/mongo/db/pipeline/document_source_limit.h b/src/mongo/db/pipeline/document_source_limit.h
index e6e5ce4c301..0a5ed1428a5 100644
--- a/src/mongo/db/pipeline/document_source_limit.h
+++ b/src/mongo/db/pipeline/document_source_limit.h
@@ -92,10 +92,6 @@ public:
_limit = newLimit;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceLimit(const boost::intrusive_ptr<ExpressionContext>& pExpCtx, long long limit);
diff --git a/src/mongo/db/pipeline/document_source_list_cached_and_active_users.h b/src/mongo/db/pipeline/document_source_list_cached_and_active_users.h
index 6cbd2115973..45df30ac5d8 100644
--- a/src/mongo/db/pipeline/document_source_list_cached_and_active_users.h
+++ b/src/mongo/db/pipeline/document_source_list_cached_and_active_users.h
@@ -109,10 +109,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceListCachedAndActiveUsers(const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
diff --git a/src/mongo/db/pipeline/document_source_list_local_sessions.h b/src/mongo/db/pipeline/document_source_list_local_sessions.h
index 0eeab06035c..57fcdf97a1e 100644
--- a/src/mongo/db/pipeline/document_source_list_local_sessions.h
+++ b/src/mongo/db/pipeline/document_source_list_local_sessions.h
@@ -123,10 +123,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceListLocalSessions(const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
const ListSessionsSpec& spec);
diff --git a/src/mongo/db/pipeline/document_source_list_sessions.h b/src/mongo/db/pipeline/document_source_list_sessions.h
index 15238c1df92..42bfe4faf71 100644
--- a/src/mongo/db/pipeline/document_source_list_sessions.h
+++ b/src/mongo/db/pipeline/document_source_list_sessions.h
@@ -96,10 +96,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceListSessions(const BSONObj& query,
const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
diff --git a/src/mongo/db/pipeline/document_source_lookup.h b/src/mongo/db/pipeline/document_source_lookup.h
index 7f9bdd715cd..1718ad5dc63 100644
--- a/src/mongo/db/pipeline/document_source_lookup.h
+++ b/src/mongo/db/pipeline/document_source_lookup.h
@@ -193,10 +193,6 @@ public:
return buildPipeline(inputDoc);
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_lookup_change_post_image.h b/src/mongo/db/pipeline/document_source_lookup_change_post_image.h
index 3814f2245b9..504ad359625 100644
--- a/src/mongo/db/pipeline/document_source_lookup_change_post_image.h
+++ b/src/mongo/db/pipeline/document_source_lookup_change_post_image.h
@@ -108,10 +108,6 @@ public:
return kStageName.rawData();
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceLookupChangePostImage(const boost::intrusive_ptr<ExpressionContext>& expCtx)
: DocumentSource(expCtx) {}
diff --git a/src/mongo/db/pipeline/document_source_match.h b/src/mongo/db/pipeline/document_source_match.h
index a11c846e786..1552c5b1219 100644
--- a/src/mongo/db/pipeline/document_source_match.h
+++ b/src/mongo/db/pipeline/document_source_match.h
@@ -162,10 +162,6 @@ public:
return boost::none;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) {
- visitor->visit(this);
- }
-
protected:
DocumentSourceMatch(const BSONObj& query,
const boost::intrusive_ptr<ExpressionContext>& expCtx);
diff --git a/src/mongo/db/pipeline/document_source_mock.h b/src/mongo/db/pipeline/document_source_mock.h
index ea1416cffcf..3fb65ba7c13 100644
--- a/src/mongo/db/pipeline/document_source_mock.h
+++ b/src/mongo/db/pipeline/document_source_mock.h
@@ -97,10 +97,6 @@ public:
return boost::none;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
// Return documents from front of queue.
std::deque<GetNextResult> queue;
diff --git a/src/mongo/db/pipeline/document_source_out.h b/src/mongo/db/pipeline/document_source_out.h
index fee56a03dbb..8f313213983 100644
--- a/src/mongo/db/pipeline/document_source_out.h
+++ b/src/mongo/db/pipeline/document_source_out.h
@@ -249,10 +249,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
// Stash the writeConcern of the original command as the operation context may change by the
// time we start to spill $out writes. This is because certain aggregations (e.g. $exchange)
diff --git a/src/mongo/db/pipeline/document_source_plan_cache_stats.h b/src/mongo/db/pipeline/document_source_plan_cache_stats.h
index 102496e334f..9f5aed005b8 100644
--- a/src/mongo/db/pipeline/document_source_plan_cache_stats.h
+++ b/src/mongo/db/pipeline/document_source_plan_cache_stats.h
@@ -123,10 +123,6 @@ public:
std::vector<Value>& array,
boost::optional<ExplainOptions::Verbosity> explain = boost::none) const override;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourcePlanCacheStats(const boost::intrusive_ptr<ExpressionContext>& expCtx);
diff --git a/src/mongo/db/pipeline/document_source_redact.h b/src/mongo/db/pipeline/document_source_redact.h
index 4babb90f0a6..a05f9d2e4ff 100644
--- a/src/mongo/db/pipeline/document_source_redact.h
+++ b/src/mongo/db/pipeline/document_source_redact.h
@@ -66,10 +66,6 @@ public:
Value serialize(boost::optional<ExplainOptions::Verbosity> explain = boost::none) const final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceRedact(const boost::intrusive_ptr<ExpressionContext>& expCtx,
const boost::intrusive_ptr<Expression>& previsit);
diff --git a/src/mongo/db/pipeline/document_source_sample.h b/src/mongo/db/pipeline/document_source_sample.h
index aa7c1e8aee1..3a5c7231d50 100644
--- a/src/mongo/db/pipeline/document_source_sample.h
+++ b/src/mongo/db/pipeline/document_source_sample.h
@@ -66,10 +66,6 @@ public:
static boost::intrusive_ptr<DocumentSource> createFromBson(
BSONElement elem, const boost::intrusive_ptr<ExpressionContext>& expCtx);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
explicit DocumentSourceSample(const boost::intrusive_ptr<ExpressionContext>& pExpCtx);
diff --git a/src/mongo/db/pipeline/document_source_sample_from_random_cursor.h b/src/mongo/db/pipeline/document_source_sample_from_random_cursor.h
index 0f607657331..8c9a6e99733 100644
--- a/src/mongo/db/pipeline/document_source_sample_from_random_cursor.h
+++ b/src/mongo/db/pipeline/document_source_sample_from_random_cursor.h
@@ -64,10 +64,6 @@ public:
std::string idField,
long long collectionSize);
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceSampleFromRandomCursor(const boost::intrusive_ptr<ExpressionContext>& expCtx,
long long size,
diff --git a/src/mongo/db/pipeline/document_source_sequential_document_cache.h b/src/mongo/db/pipeline/document_source_sequential_document_cache.h
index 6d529254766..fa7d9133a2b 100644
--- a/src/mongo/db/pipeline/document_source_sequential_document_cache.h
+++ b/src/mongo/db/pipeline/document_source_sequential_document_cache.h
@@ -83,10 +83,6 @@ public:
_cache->abandon();
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
Pipeline::SourceContainer::iterator doOptimizeAt(Pipeline::SourceContainer::iterator itr,
Pipeline::SourceContainer* container) final;
diff --git a/src/mongo/db/pipeline/document_source_single_document_transformation.h b/src/mongo/db/pipeline/document_source_single_document_transformation.h
index d9f874fde64..97f1d79ca2a 100644
--- a/src/mongo/db/pipeline/document_source_single_document_transformation.h
+++ b/src/mongo/db/pipeline/document_source_single_document_transformation.h
@@ -84,10 +84,6 @@ public:
return _parsedTransform->isSubsetOfProjection(proj);
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_skip.h b/src/mongo/db/pipeline/document_source_skip.h
index 70ccb99b859..d6bc4c88458 100644
--- a/src/mongo/db/pipeline/document_source_skip.h
+++ b/src/mongo/db/pipeline/document_source_skip.h
@@ -96,10 +96,6 @@ public:
_nToSkip = newSkip;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
explicit DocumentSourceSkip(const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
long long nToSkip);
diff --git a/src/mongo/db/pipeline/document_source_sort.h b/src/mongo/db/pipeline/document_source_sort.h
index cdb0bcadb99..eeca2371b6e 100644
--- a/src/mongo/db/pipeline/document_source_sort.h
+++ b/src/mongo/db/pipeline/document_source_sort.h
@@ -140,10 +140,6 @@ public:
return _limitSrc;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
/**
* Attempts to absorb a subsequent $limit stage so that it an perform a top-k sort.
diff --git a/src/mongo/db/pipeline/document_source_tee_consumer.h b/src/mongo/db/pipeline/document_source_tee_consumer.h
index 0279c001a76..3c5ae5fc729 100644
--- a/src/mongo/db/pipeline/document_source_tee_consumer.h
+++ b/src/mongo/db/pipeline/document_source_tee_consumer.h
@@ -78,10 +78,6 @@ public:
Value serialize(boost::optional<ExplainOptions::Verbosity> explain = boost::none) const final;
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
protected:
void doDispose() final;
diff --git a/src/mongo/db/pipeline/document_source_test_optimizations.h b/src/mongo/db/pipeline/document_source_test_optimizations.h
index 1c0bb51d25b..6bda5052d81 100644
--- a/src/mongo/db/pipeline/document_source_test_optimizations.h
+++ b/src/mongo/db/pipeline/document_source_test_optimizations.h
@@ -63,10 +63,6 @@ public:
MONGO_UNREACHABLE;
}
- virtual void acceptVisitor(DocumentSourceVisitor* visitor) override {
- visitor->visit(this);
- }
-
private:
virtual Value serialize(boost::optional<ExplainOptions::Verbosity>) const override {
MONGO_UNREACHABLE;
diff --git a/src/mongo/db/pipeline/document_source_unwind.h b/src/mongo/db/pipeline/document_source_unwind.h
index 3904cc602de..7948f6fdcd6 100644
--- a/src/mongo/db/pipeline/document_source_unwind.h
+++ b/src/mongo/db/pipeline/document_source_unwind.h
@@ -90,10 +90,6 @@ public:
return _indexPath;
}
- void acceptVisitor(DocumentSourceVisitor* visitor) final {
- visitor->visit(this);
- }
-
private:
DocumentSourceUnwind(const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
const FieldPath& fieldPath,
diff --git a/src/mongo/db/pipeline/document_source_visitor.h b/src/mongo/db/pipeline/document_source_visitor.h
deleted file mode 100644
index 58a8d3aebf6..00000000000
--- a/src/mongo/db/pipeline/document_source_visitor.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Copyright (C) 2019-present MongoDB, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the Server Side Public License, version 1,
- * as published by MongoDB, Inc.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Server Side Public License for more details.
- *
- * You should have received a copy of the Server Side Public License
- * along with this program. If not, see
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the Server Side Public License in all respects for
- * all of the code used other than as permitted herein. If you modify file(s)
- * with this exception, you may extend this exception to your version of the
- * file(s), but you are not obligated to do so. If you do not wish to do so,
- * delete this exception statement from your version. If you delete this
- * exception statement from all source files in the program, then also delete
- * it in the license file.
- */
-
-#pragma once
-
-namespace mongo {
-
-class DocumentSourceMergeCursors;
-class DocumentSourceSequentialDocumentCache;
-class DocumentSourceSample;
-class DocumentSourceUnwind;
-class DocumentSourceCloseCursor;
-class DocumentSourceGeoNear;
-class DocumentSourceLookUp;
-class DocumentSourceInternalInhibitOptimization;
-class DocumentSourceLookupChangePostImage;
-class DocumentSourceListCachedAndActiveUsers;
-class DocumentSourceChangeStreamTransform;
-class DocumentSourceOut;
-class DocumentSourceRedact;
-class DocumentSourceGraphLookUp;
-class DocumentSourceExchange;
-class DocumentSourceCursor;
-class DocumentSourceBucketAuto;
-class DocumentSourceSkip;
-class DocumentSourceSort;
-class DocumentSourceGroup;
-class DocumentSourceMock;
-class DocumentSourceListLocalSessions;
-class DocumentSourcePlanCacheStats;
-class DocumentSourceIndexStats;
-class DocumentSourceLimit;
-class DocumentSourceCurrentOp;
-class DocumentSourceSingleDocumentTransformation;
-class DocumentSourceChangeStream;
-class DocumentSourceShardCheckResumability;
-class DocumentSourceEnsureResumeTokenPresent;
-class DocumentSourceCheckInvalidate;
-class DocumentSourceFacet;
-class DocumentSourceInternalSplitPipeline;
-class DocumentSourceListSessions;
-class DocumentSourceCollStats;
-class DocumentSourceTeeConsumer;
-class DocumentSourceSampleFromRandomCursor;
-class DocumentSourceMatch;
-class DocumentSourceOplogMatch;
-class DocumentSourceUpdateOnAddShard;
-class DocumentSourceBackupCursorExtend;
-class DocumentSourceBackupCursor;
-class DocumentSourceTestOptimizations;
-
-/**
- * This is a base class to allow for dynamic dispatch on a DocumentSource. It implements the visitor
- * pattern, in which every derived class from DocumentSource implements an acceptVisitor() method,
- * which simply calls the appropriate visit() method on the derived DocumentSourceVisitor class. The
- * derived class can do whatever it needs to do for each specific node type in the corresponding
- * visit() method.
- */
-class DocumentSourceVisitor {
-public:
- virtual ~DocumentSourceVisitor() = default;
-
- virtual void visit(DocumentSourceMergeCursors* source) = 0;
- virtual void visit(DocumentSourceSequentialDocumentCache* source) = 0;
- virtual void visit(DocumentSourceSample* source) = 0;
- virtual void visit(DocumentSourceUnwind* source) = 0;
- virtual void visit(DocumentSourceCloseCursor* source) = 0;
- virtual void visit(DocumentSourceGeoNear* source) = 0;
- virtual void visit(DocumentSourceLookUp* source) = 0;
- virtual void visit(DocumentSourceInternalInhibitOptimization* source) = 0;
- virtual void visit(DocumentSourceLookupChangePostImage* source) = 0;
- virtual void visit(DocumentSourceListCachedAndActiveUsers* source) = 0;
- virtual void visit(DocumentSourceChangeStreamTransform* source) = 0;
- virtual void visit(DocumentSourceOut* source) = 0;
- virtual void visit(DocumentSourceRedact* source) = 0;
- virtual void visit(DocumentSourceGraphLookUp* source) = 0;
- virtual void visit(DocumentSourceExchange* source) = 0;
- virtual void visit(DocumentSourceCursor* source) = 0;
- virtual void visit(DocumentSourceBucketAuto* source) = 0;
- virtual void visit(DocumentSourceSkip* source) = 0;
- virtual void visit(DocumentSourceSort* source) = 0;
- virtual void visit(DocumentSourceGroup* source) = 0;
- virtual void visit(DocumentSourceMock* source) = 0;
- virtual void visit(DocumentSourceListLocalSessions* source) = 0;
- virtual void visit(DocumentSourcePlanCacheStats* source) = 0;
- virtual void visit(DocumentSourceIndexStats* source) = 0;
- virtual void visit(DocumentSourceLimit* source) = 0;
- virtual void visit(DocumentSourceCurrentOp* source) = 0;
- virtual void visit(DocumentSourceSingleDocumentTransformation* source) = 0;
- virtual void visit(DocumentSourceOplogMatch* source) = 0;
- virtual void visit(DocumentSourceShardCheckResumability* source) = 0;
- virtual void visit(DocumentSourceEnsureResumeTokenPresent* source) = 0;
- virtual void visit(DocumentSourceCheckInvalidate* source) = 0;
- virtual void visit(DocumentSourceFacet* source) = 0;
- virtual void visit(DocumentSourceInternalSplitPipeline* source) = 0;
- virtual void visit(DocumentSourceListSessions* source) = 0;
- virtual void visit(DocumentSourceCollStats* source) = 0;
- virtual void visit(DocumentSourceTeeConsumer* source) = 0;
- virtual void visit(DocumentSourceSampleFromRandomCursor* source) = 0;
- virtual void visit(DocumentSourceMatch* source) = 0;
- virtual void visit(DocumentSourceUpdateOnAddShard* source) = 0;
- virtual void visit(DocumentSourceBackupCursorExtend* source) = 0;
- virtual void visit(DocumentSourceBackupCursor* source) = 0;
- virtual void visit(DocumentSourceTestOptimizations* source) = 0;
-};
-
-} // namespace mongo