summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/accumulator_multi.cpp
diff options
context:
space:
mode:
authorMihai Andrei <mihai.andrei@10gen.com>2021-11-24 10:06:39 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-02 17:39:48 +0000
commitcd115664da842ce04f0e2023bb9e7552066f4066 (patch)
tree18ca972b1b1e86942be2ec780b912717543adbe4 /src/mongo/db/pipeline/accumulator_multi.cpp
parent0fec1c75cd6590b5ca7ec0b4f5cd0fcb75b66a36 (diff)
downloadmongo-cd115664da842ce04f0e2023bb9e7552066f4066.tar.gz
SERVER-52247 Enable feature flag for Exact top-n accumulator
Diffstat (limited to 'src/mongo/db/pipeline/accumulator_multi.cpp')
-rw-r--r--src/mongo/db/pipeline/accumulator_multi.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/mongo/db/pipeline/accumulator_multi.cpp b/src/mongo/db/pipeline/accumulator_multi.cpp
index 541ca0b0bd7..0bc21ac7562 100644
--- a/src/mongo/db/pipeline/accumulator_multi.cpp
+++ b/src/mongo/db/pipeline/accumulator_multi.cpp
@@ -35,91 +35,93 @@ namespace mongo {
using FirstLastSense = AccumulatorFirstLastN::Sense;
using MinMaxSense = AccumulatorMinMax::Sense;
-// TODO SERVER-52247 Replace boost::none with 'gFeatureFlagExactTopNAccumulator.getVersion()' below
-// once 'gFeatureFlagExactTopNAccumulator' is set to true by default and is configured with an FCV.
+// Register macros for the various accumulators/expressions in this file. Note that we check
+// 'isEnabledAndIgnoreFCV()' because the feature flag is a property set at startup, while FCV can
+// change while the server is running.
+// TODO SERVER-61855 Add these accumulators/expressions to the stable API.
REGISTER_ACCUMULATOR_CONDITIONALLY(
maxN,
AccumulatorMinMaxN::parseMinMaxN<MinMaxSense::kMax>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
minN,
AccumulatorMinMaxN::parseMinMaxN<MinMaxSense::kMin>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_EXPRESSION_CONDITIONALLY(
maxN,
AccumulatorMinMaxN::parseExpression<MinMaxSense::kMax>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_EXPRESSION_CONDITIONALLY(
minN,
AccumulatorMinMaxN::parseExpression<MinMaxSense::kMin>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
firstN,
AccumulatorFirstLastN::parseFirstLastN<FirstLastSense::kFirst>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
lastN,
AccumulatorFirstLastN::parseFirstLastN<FirstLastSense::kLast>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_EXPRESSION_CONDITIONALLY(
firstN,
AccumulatorFirstLastN::parseExpression<FirstLastSense::kFirst>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_EXPRESSION_CONDITIONALLY(
lastN,
AccumulatorFirstLastN::parseExpression<FirstLastSense::kLast>,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
topN,
(AccumulatorTopBottomN<TopBottomSense::kTop, false>::parseTopBottomN),
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
bottomN,
(AccumulatorTopBottomN<TopBottomSense::kBottom, false>::parseTopBottomN),
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
top,
(AccumulatorTopBottomN<TopBottomSense::kTop, true>::parseTopBottomN),
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
REGISTER_ACCUMULATOR_CONDITIONALLY(
bottom,
(AccumulatorTopBottomN<TopBottomSense::kBottom, true>::parseTopBottomN),
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- boost::none,
+ feature_flags::gFeatureFlagExactTopNAccumulator.getVersion(),
feature_flags::gFeatureFlagExactTopNAccumulator.isEnabledAndIgnoreFCV());
// TODO SERVER-57886 Add $topN/$bottomN/$top/$bottom as window functions.