summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_bucket_auto.h
diff options
context:
space:
mode:
authorryankall <ryan11432@gmail.com>2017-05-03 14:46:39 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2017-05-03 17:45:07 -0400
commit2c00a571f4549ccdfb427b1f096157290662a0f7 (patch)
tree30d2d296febc96e7b110cf32235bee7ea6a1af99 /src/mongo/db/pipeline/document_source_bucket_auto.h
parentb54a4c655b2f35ebaae739f959e6e5b7d48f5f04 (diff)
downloadmongo-2c00a571f4549ccdfb427b1f096157290662a0f7.tar.gz
SERVER-25980 Merge parallel vectors into one.
Merges the three parallel vectors in DocumentSourceGroup and DocumentSourceBucketAuto into one vector of AccumulationStatements. Closes #1143 Signed-off-by: Charlie Swanson <charlie.swanson@mongodb.com>
Diffstat (limited to 'src/mongo/db/pipeline/document_source_bucket_auto.h')
-rw-r--r--src/mongo/db/pipeline/document_source_bucket_auto.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mongo/db/pipeline/document_source_bucket_auto.h b/src/mongo/db/pipeline/document_source_bucket_auto.h
index a60bf5cb752..2a40b092c1f 100644
--- a/src/mongo/db/pipeline/document_source_bucket_auto.h
+++ b/src/mongo/db/pipeline/document_source_bucket_auto.h
@@ -96,7 +96,7 @@ private:
Bucket(const boost::intrusive_ptr<ExpressionContext>& expCtx,
Value min,
Value max,
- std::vector<Accumulator::Factory> accumulatorFactories);
+ const std::vector<AccumulationStatement>& accumulationStatements);
Value _min;
Value _max;
std::vector<boost::intrusive_ptr<Accumulator>> _accums;
@@ -139,13 +139,7 @@ private:
std::unique_ptr<Sorter<Value, Document>> _sorter;
std::unique_ptr<Sorter<Value, Document>::Iterator> _sortedInput;
- // _fieldNames contains the field names for the result documents, _accumulatorFactories contains
- // the accumulator factories for the result documents, and _expressions contains the common
- // expressions used by each instance of each accumulator in order to find the right-hand side of
- // what gets added to the accumulator. These three vectors parallel each other.
- std::vector<std::string> _fieldNames;
- std::vector<Accumulator::Factory> _accumulatorFactories;
- std::vector<boost::intrusive_ptr<Expression>> _expressions;
+ std::vector<AccumulationStatement> _accumulatedFields;
int _nBuckets;
uint64_t _maxMemoryUsageBytes;