summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
diff options
context:
space:
mode:
authorMartin Neupauer <martin.neupauer@10gen.com>2018-04-19 14:04:00 -0400
committerMartin Neupauer <martin.neupauer@mongodb.com>2018-04-23 15:42:36 -0400
commit559910472384b3625fca4d9eca47dd9d165c6958 (patch)
treea11bf817e36e727966449b90688e945921be99cf /src/mongo/s/commands/cluster_move_chunk_cmd.cpp
parent2ca9e55b076d5bd117c44780ed7646b8b772d2d3 (diff)
downloadmongo-559910472384b3625fca4d9eca47dd9d165c6958.tar.gz
SERVER-34100 - Make the Chunk object not expose implementation details of the ChunkManager
Diffstat (limited to 'src/mongo/s/commands/cluster_move_chunk_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_move_chunk_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
index e7e97ef2df1..bbb6ca5caa2 100644
--- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
+++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
@@ -143,7 +143,7 @@ public:
return false;
}
- std::shared_ptr<Chunk> chunk;
+ boost::optional<Chunk> chunk;
if (!find.isEmpty()) {
// find
@@ -154,7 +154,7 @@ public:
return false;
}
- chunk = cm->findIntersectingChunkWithSimpleCollation(shardKey);
+ chunk.emplace(cm->findIntersectingChunkWithSimpleCollation(shardKey));
} else {
// bounds
if (!cm->getShardKeyPattern().isShardKey(bounds[0].Obj()) ||
@@ -169,7 +169,7 @@ public:
BSONObj minKey = cm->getShardKeyPattern().normalizeShardKey(bounds[0].Obj());
BSONObj maxKey = cm->getShardKeyPattern().normalizeShardKey(bounds[1].Obj());
- chunk = cm->findIntersectingChunkWithSimpleCollation(minKey);
+ chunk.emplace(cm->findIntersectingChunkWithSimpleCollation(minKey));
if (chunk->getMin().woCompare(minKey) != 0 || chunk->getMax().woCompare(maxKey) != 0) {
errmsg = str::stream() << "no chunk found with the shard key bounds "