summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_manager.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2021-10-20 16:36:13 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-20 17:24:22 +0000
commitd881f91800f3d213df8348a6acacdad9dff174da (patch)
tree09f3781ebb7db9caca98a8153aec8aa21d6f15dd /src/mongo/s/chunk_manager.cpp
parent0273057add47dde4575aa794edc07f8c7520d0d8 (diff)
downloadmongo-d881f91800f3d213df8348a6acacdad9dff174da.tar.gz
SERVER-31540 Get rid of boost::optional<UUID> from sharding code
Diffstat (limited to 'src/mongo/s/chunk_manager.cpp')
-rw-r--r--src/mongo/s/chunk_manager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp
index 1e954d001b9..09d0306bbc6 100644
--- a/src/mongo/s/chunk_manager.cpp
+++ b/src/mongo/s/chunk_manager.cpp
@@ -313,7 +313,7 @@ ShardVersionTargetingInfo::ShardVersionTargetingInfo(const OID& epoch, const Tim
RoutingTableHistory::RoutingTableHistory(
NamespaceString nss,
- boost::optional<UUID> uuid,
+ UUID uuid,
KeyPattern shardKeyPattern,
std::unique_ptr<CollatorInterface> defaultCollator,
bool unique,
@@ -323,8 +323,8 @@ RoutingTableHistory::RoutingTableHistory(
bool allowMigrations,
ChunkMap chunkMap)
: _nss(std::move(nss)),
- _uuid(uuid),
- _shardKeyPattern(shardKeyPattern),
+ _uuid(std::move(uuid)),
+ _shardKeyPattern(std::move(shardKeyPattern)),
_defaultCollator(std::move(defaultCollator)),
_unique(unique),
_timeseriesFields(std::move(timeseriesFields)),
@@ -407,8 +407,7 @@ void ChunkManager::getShardIdsForQuery(boost::intrusive_ptr<ExpressionContext> e
auto findCommand = std::make_unique<FindCommandRequest>(_rt->optRt->nss());
findCommand->setFilter(query.getOwned());
- if (auto uuid = getUUID())
- expCtx->uuid = uuid;
+ expCtx->uuid = getUUID();
if (!collation.isEmpty()) {
findCommand->setCollation(collation.getOwned());
@@ -765,7 +764,7 @@ std::string RoutingTableHistory::toString() const {
RoutingTableHistory RoutingTableHistory::makeNew(
NamespaceString nss,
- boost::optional<UUID> uuid,
+ UUID uuid,
KeyPattern shardKeyPattern,
std::unique_ptr<CollatorInterface> defaultCollator,
bool unique,
@@ -799,6 +798,7 @@ RoutingTableHistory RoutingTableHistory::makeUpdated(
boost::optional<uint64_t> maxChunkSizeBytes,
bool allowMigrations,
const std::vector<ChunkType>& changedChunks) const {
+
auto changedChunkInfos = flatten(changedChunks);
auto chunkMap = _chunkMap.createMerged(changedChunkInfos);