summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_writer.h
diff options
context:
space:
mode:
authorMihai Andrei <mihai.andrei@10gen.com>2022-07-27 20:35:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-27 23:38:57 +0000
commit7b7fe658db948e6f5a4a6c30d4590d7866c59371 (patch)
tree7b0be78f6441fc8ea2f3fb9a14b254378a1c1dc6 /src/mongo/db/pipeline/document_source_writer.h
parent586135f8159f72b2f42b1cbd96c93fbfbc84c13b (diff)
downloadmongo-7b7fe658db948e6f5a4a6c30d4590d7866c59371.tar.gz
SERVER-66289 Update write size estimation logic in DocumentSourceWriter
Diffstat (limited to 'src/mongo/db/pipeline/document_source_writer.h')
-rw-r--r--src/mongo/db/pipeline/document_source_writer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_writer.h b/src/mongo/db/pipeline/document_source_writer.h
index 1965bd4dee6..284699deb30 100644
--- a/src/mongo/db/pipeline/document_source_writer.h
+++ b/src/mongo/db/pipeline/document_source_writer.h
@@ -104,7 +104,9 @@ public:
const boost::intrusive_ptr<ExpressionContext>& expCtx)
: DocumentSource(stageName, expCtx),
_outputNs(std::move(outputNs)),
- _writeConcern(expCtx->opCtx->getWriteConcern()) {}
+ _writeConcern(expCtx->opCtx->getWriteConcern()),
+ _writeSizeEstimator(
+ expCtx->mongoProcessInterface->getWriteSizeEstimator(expCtx->opCtx, outputNs)) {}
DepsTracker::State getDependencies(DepsTracker* deps) const override {
deps->needWholeDocument = true;
@@ -169,6 +171,9 @@ protected:
// respect the writeConcern of the original command.
WriteConcernOptions _writeConcern;
+ // An interface that is used to estimate the size of each write operation.
+ const std::unique_ptr<MongoProcessInterface::WriteSizeEstimator> _writeSizeEstimator;
+
private:
bool _initialized{false};
bool _done{false};