summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2022-08-23 20:40:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-23 21:38:13 +0000
commite5e2aba7f1f604a373a09e43b7e184d44f8b4c35 (patch)
tree74e27ded922f25736f4ea85a167c1d1a1aad27b2 /src
parent9ca61a6d178ec3bb2fe46c93e31c6ac3a503c75d (diff)
downloadmongo-e5e2aba7f1f604a373a09e43b7e184d44f8b4c35.tar.gz
SERVER-52130 Create feature flag for PM-1858
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/SConscript13
-rw-r--r--src/mongo/db/s/analyze_shard_key_feature_flag.idl41
-rw-r--r--src/mongo/s/SConscript1
3 files changed, 55 insertions, 0 deletions
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript
index d34b19aa147..1ce766d5a35 100644
--- a/src/mongo/db/s/SConscript
+++ b/src/mongo/db/s/SConscript
@@ -339,6 +339,18 @@ env.Library(
)
env.Library(
+ target='analyze_shard_key',
+ source=[
+ 'analyze_shard_key_feature_flag.idl',
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/idl/feature_flag',
+ '$BUILD_DIR/mongo/idl/idl_parser',
+ ],
+)
+
+env.Library(
target='sharding_commands_d',
source=[
'add_shard_cmd.cpp',
@@ -497,6 +509,7 @@ env.Library(
'$BUILD_DIR/mongo/s/commands/sharded_cluster_sharding_commands',
'$BUILD_DIR/mongo/s/sharding_initialization',
'$BUILD_DIR/mongo/s/sharding_router_api',
+ 'analyze_shard_key',
'forwardable_operation_metadata',
'sharding_logging',
'sharding_runtime_d',
diff --git a/src/mongo/db/s/analyze_shard_key_feature_flag.idl b/src/mongo/db/s/analyze_shard_key_feature_flag.idl
new file mode 100644
index 00000000000..fde43803843
--- /dev/null
+++ b/src/mongo/db/s/analyze_shard_key_feature_flag.idl
@@ -0,0 +1,41 @@
+# Copyright (C) 2022-present MongoDB, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Server Side Public License, version 1,
+# as published by MongoDB, Inc.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Server Side Public License for more details.
+#
+# You should have received a copy of the Server Side Public License
+# along with this program. If not, see
+# <http://www.mongodb.com/licensing/server-side-public-license>.
+#
+# As a special exception, the copyright holders give permission to link the
+# code of portions of this program with the OpenSSL library under certain
+# conditions as described in each individual source file and distribute
+# linked combinations including the program with the OpenSSL library. You
+# must comply with the Server Side Public License in all respects for
+# all of the code used other than as permitted herein. If you modify file(s)
+# with this exception, you may extend this exception to your version of the
+# file(s), but you are not obligated to do so. If you do not wish to do so,
+# delete this exception statement from your version. If you delete this
+# exception statement from all source files in the program, then also delete
+# it in the license file.
+#
+
+# Feature flag for the 'analyzeShardKey' command.
+
+global:
+ cpp_namespace: "mongo::analyze_shard_key"
+
+imports:
+ - "mongo/idl/basic_types.idl"
+
+feature_flags:
+ featureFlagAnalyzeShardKey:
+ description: When enabled, allows users to calculate metrics for evaluating a shard key.
+ cpp_varname: gFeatureFlagAnalyzeShardKey
+ default: false
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index 190b6df6c7d..9fc29ecd0c2 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -207,6 +207,7 @@ env.Library(
'$BUILD_DIR/mongo/db/index_commands_idl',
'$BUILD_DIR/mongo/db/query/query_request',
'$BUILD_DIR/mongo/db/repl/optime',
+ '$BUILD_DIR/mongo/db/s/analyze_shard_key',
'$BUILD_DIR/mongo/db/server_options',
],
LIBDEPS_PRIVATE=[