From 343f3254f99827864cf1978b77488aff792ae8bb Mon Sep 17 00:00:00 2001 From: Hugh Han Date: Thu, 13 Jul 2017 15:15:11 -0400 Subject: SERVER-29979 Move SplitChunk Logic from split_chunk_command to split_chunk split_chunk_command currently contains all of the SplitChunk logic. This commit moves the logic into a separate module. --- src/mongo/db/s/sharding_state.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mongo/db/s/sharding_state.cpp') diff --git a/src/mongo/db/s/sharding_state.cpp b/src/mongo/db/s/sharding_state.cpp index d9273b5cfc1..693b9085684 100644 --- a/src/mongo/db/s/sharding_state.cpp +++ b/src/mongo/db/s/sharding_state.cpp @@ -131,6 +131,11 @@ bool ShardingState::enabled() const { return _getInitializationState() == InitializationState::kInitialized; } +void ShardingState::setEnabledForTest(const std::string& shardName) { + _setInitializationState(InitializationState::kInitialized); + _shardName = shardName; +} + Status ShardingState::canAcceptShardedCommands() const { if (serverGlobalParams.clusterRole != ClusterRole::ShardServer) { return {ErrorCodes::NoShardingEnabled, -- cgit v1.2.1