summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_exchange.h
diff options
context:
space:
mode:
authorMartin Neupauer <martin.neupauer@mongodb.com>2018-10-02 14:21:22 -0400
committerMartin Neupauer <martin.neupauer@mongodb.com>2018-10-08 14:43:32 -0400
commit93e66d955ec346db14d85e0d3d1685ceccf0d043 (patch)
treee49c7f7df63f7be19b4bad6b13a7660dbfe974e4 /src/mongo/db/pipeline/document_source_exchange.h
parent8e46857abfa06891512ceef03fb539d7d3f47d13 (diff)
downloadmongo-93e66d955ec346db14d85e0d3d1685ceccf0d043.tar.gz
SERVER-37076 Aggregation exchange partitioning does not work correctly for dotted keys.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_exchange.h')
-rw-r--r--src/mongo/db/pipeline/document_source_exchange.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_exchange.h b/src/mongo/db/pipeline/document_source_exchange.h
index 6a3c4324b65..14f6943a677 100644
--- a/src/mongo/db/pipeline/document_source_exchange.h
+++ b/src/mongo/db/pipeline/document_source_exchange.h
@@ -34,6 +34,7 @@
#include "mongo/bson/ordering.h"
#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/exchange_spec_gen.h"
+#include "mongo/db/pipeline/field_path.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/mutex.h"
@@ -61,7 +62,12 @@ class Exchange : public RefCountable {
/**
* Extract the order description from the key.
*/
- static Ordering extractOrdering(const BSONObj& obj);
+ static Ordering extractOrdering(const BSONObj& keyPattern);
+
+ /**
+ * Extract dotted paths from the key.
+ */
+ static std::vector<FieldPath> extractKeyPaths(const BSONObj& keyPattern);
public:
Exchange(ExchangeSpec spec, std::unique_ptr<Pipeline, PipelineDeleter> pipeline);
@@ -103,6 +109,8 @@ private:
const Ordering _ordering;
+ const std::vector<FieldPath> _keyPaths;
+
// Range boundaries. The boundaries are ordered and must cover the whole domain, e.g.
// [Min, -200, 0, 200, Max] partitions the domain into 4 ranges (i.e. 1 less than number of
// boundaries). Every range has an assigned consumer that will process documents in that range.