diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-08-01 08:33:20 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-08-24 09:42:50 -0400 |
commit | 7987c50c9702bf2280ca4f902499f58f98448241 (patch) | |
tree | 6fda98cf2e2fcbb45fde0f4c2f693902c14f0335 /src/mongo/db/pipeline/pipeline.h | |
parent | c8f5485a7c5455b5487990113597f935d1df1ddf (diff) | |
download | mongo-7987c50c9702bf2280ca4f902499f58f98448241.tar.gz |
SERVER-35905 Add logic to detect when $out is eligible for an exchange
Diffstat (limited to 'src/mongo/db/pipeline/pipeline.h')
-rw-r--r-- | src/mongo/db/pipeline/pipeline.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/pipeline.h b/src/mongo/db/pipeline/pipeline.h index d3e99daae31..4874126b398 100644 --- a/src/mongo/db/pipeline/pipeline.h +++ b/src/mongo/db/pipeline/pipeline.h @@ -132,6 +132,19 @@ public: */ static bool aggSupportsWriteConcern(const BSONObj& cmd); + /** + * Given 'pathsOfInterest' which describes a set of paths which the caller is interested in, + * returns boost::none if any of those paths are modified by the section of a pipeline + * described by 'rstart' and 'rend', or a mapping from their name at the end of the pipeline to + * their name at the beginning of the pipeline if they are preserved but possibly renamed by + * this pipeline. Note that the analysis proceeds backwards, so the iterators must be reverse + * iterators. + */ + static boost::optional<StringMap<std::string>> renamedPaths( + SourceContainer::const_reverse_iterator rstart, + SourceContainer::const_reverse_iterator rend, + std::set<std::string> pathsOfInterest); + const boost::intrusive_ptr<ExpressionContext>& getContext() const { return pCtx; } @@ -250,6 +263,15 @@ public: */ DepsTracker getDependencies(DepsTracker::MetadataAvailable metadataAvailable) const; + /** + * Given 'pathsOfInterest' which describes a set of paths which the caller is interested in, + * returns boost::none if any of those paths are modified by this pipeline, or a mapping from + * their name at the end of the pipeline to their name at the beginning of the pipeline if they + * are preserved but possibly renamed by this pipeline. + */ + boost::optional<StringMap<std::string>> renamedPaths( + std::set<std::string> pathsOfInterest) const; + const SourceContainer& getSources() const { return _sources; } |