summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_aggregation_planner.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/query/cluster_aggregation_planner.h')
-rw-r--r--src/mongo/s/query/cluster_aggregation_planner.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mongo/s/query/cluster_aggregation_planner.h b/src/mongo/s/query/cluster_aggregation_planner.h
index cf8c52583ff..68c09cc1edb 100644
--- a/src/mongo/s/query/cluster_aggregation_planner.h
+++ b/src/mongo/s/query/cluster_aggregation_planner.h
@@ -82,12 +82,14 @@ struct AggregationTargeter {
boost::optional<ChunkManager> cm,
stdx::unordered_set<NamespaceString> involvedNamespaces,
bool hasChangeStream,
- bool allowedToPassthrough);
+ bool allowedToPassthrough,
+ bool perShardCursor);
enum TargetingPolicy {
kPassthrough,
kMongosRequired,
kAnyShard,
+ kSpecificShardOnly,
} policy;
std::unique_ptr<Pipeline, PipelineDeleter> pipeline;
@@ -125,5 +127,20 @@ Status dispatchPipelineAndMerge(OperationContext* opCtx,
BSONObjBuilder* result,
bool hasChangeStream);
+/**
+ * Similar to runPipelineOnPrimaryShard but allows $changeStreams. Intended for use by per shard
+ * $changeStream cursors. Note: if forPerShardCursor is true shard versions will not be added to the
+ * request sent to mongod.
+ */
+Status runPipelineOnSpecificShardOnly(const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ const ClusterAggregate::Namespaces& namespaces,
+ const ChunkManager& cm,
+ boost::optional<ExplainOptions::Verbosity> explain,
+ Document serializedCommand,
+ const PrivilegeVector& privileges,
+ ShardId shardId,
+ bool forPerShardCursor,
+ BSONObjBuilder* out);
+
} // namespace cluster_aggregation_planner
} // namespace mongo