summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_facet.h
diff options
context:
space:
mode:
authorCharlie Swanson <cswanson310@gmail.com>2016-08-29 18:02:04 -0400
committerCharlie Swanson <cswanson310@gmail.com>2016-09-01 14:08:25 -0400
commitd289e240b653e70a7d90be885a3ad6de21b7c6cb (patch)
tree5a19c87341c92bc0307733229d114f5d5fe899e6 /src/mongo/db/pipeline/document_source_facet.h
parenta36409076c3de29c15e497ca3065e775e7369fa3 (diff)
downloadmongo-d289e240b653e70a7d90be885a3ad6de21b7c6cb.tar.gz
SERVER-25864 Propagate calls to needsPrimaryShardMerger through $facet.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_facet.h')
-rw-r--r--src/mongo/db/pipeline/document_source_facet.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/document_source_facet.h b/src/mongo/db/pipeline/document_source_facet.h
index 267ebe58bb2..81f7b23e9cf 100644
--- a/src/mongo/db/pipeline/document_source_facet.h
+++ b/src/mongo/db/pipeline/document_source_facet.h
@@ -53,9 +53,6 @@ class Pipeline;
* For example, {$facet: {facetA: [{$skip: 1}], facetB: [{$limit: 1}]}} would describe a $facet
* stage which will produce a document like the following:
* {facetA: [<all input documents except the first one>], facetB: [<the first document>]}.
- *
- * TODO SERVER-24154: Should inherit from SplittableDocumentSource so that it can split in a sharded
- * cluster.
*/
class DocumentSourceFacet final : public DocumentSourceNeedsMongod,
public SplittableDocumentSource {
@@ -98,6 +95,9 @@ public:
/**
* The $facet stage must be run on the merging shard.
+ *
+ * TODO SERVER-24154: Should be smarter about splitting so that parts of the sub-pipelines can
+ * potentially be run in parallel on multiple shards.
*/
boost::intrusive_ptr<DocumentSource> getShardSource() final {
return nullptr;
@@ -111,6 +111,7 @@ public:
void doInjectMongodInterface(std::shared_ptr<MongodInterface> mongod) final;
void doDetachFromOperationContext() final;
void doReattachToOperationContext(OperationContext* opCtx) final;
+ bool needsPrimaryShard() const final;
private:
DocumentSourceFacet(StringMap<boost::intrusive_ptr<Pipeline>> facetPipelines,