summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorTommaso Tocci <tommaso.tocci@mongodb.com>2020-02-20 11:57:26 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-03 21:18:53 +0000
commit40de1061816ea7e9b115ac728fb80ba46cc2176d (patch)
treefcc4e7eb885753679404f0036c4ac5bab226dc97 /src/mongo/db/pipeline
parent61865d1617e39506c9e0c9202ba2bb50217c7c1e (diff)
downloadmongo-40de1061816ea7e9b115ac728fb80ba46cc2176d.tar.gz
SERVER-45780 Rename getCurrentMetadata
to getCollectionDescription and change the return type
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp b/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp
index 1823f8a1f70..9fa7b4fc59d 100644
--- a/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp
@@ -74,8 +74,7 @@ void attachWriteConcern(const WriteConcernOptions& writeConcern, BatchedCommandR
bool ShardServerProcessInterface::isSharded(OperationContext* opCtx, const NamespaceString& nss) {
Lock::DBLock dbLock(opCtx, nss.db(), MODE_IS);
Lock::CollectionLock collLock(opCtx, nss, MODE_IS);
- const auto metadata = CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
- return metadata->isSharded();
+ return CollectionShardingState::get(opCtx, nss)->getCollectionDescription().isSharded();
}
void ShardServerProcessInterface::checkRoutingInfoEpochOrThrow(
@@ -94,15 +93,15 @@ ShardServerProcessInterface::collectDocumentKeyFieldsForHostedCollection(Operati
UUID uuid) const {
invariant(serverGlobalParams.clusterRole == ClusterRole::ShardServer);
- const auto metadata = [opCtx, &nss]() -> ScopedCollectionMetadata {
+ const auto collDesc = [opCtx, &nss]() -> ScopedCollectionDescription {
Lock::DBLock dbLock(opCtx, nss.db(), MODE_IS);
Lock::CollectionLock collLock(opCtx, nss, MODE_IS);
- return CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
+ return CollectionShardingState::get(opCtx, nss)->getCollectionDescription();
}();
- if (!metadata->isSharded() || !metadata->uuidMatches(uuid)) {
+ if (!collDesc.isSharded() || !collDesc.uuidMatches(uuid)) {
// An unsharded collection can still become sharded so is not final. If the uuid doesn't
- // match the one stored in the ScopedCollectionMetadata, this implies that the collection
+ // match the one stored in the ScopedCollectionDescription, this implies that the collection
// has been dropped and recreated as sharded. We don't know what the old document key fields
// might have been in this case so we return just _id.
return {{"_id"}, false};
@@ -110,7 +109,7 @@ ShardServerProcessInterface::collectDocumentKeyFieldsForHostedCollection(Operati
// Unpack the shard key. Collection is now sharded so the document key fields will never change,
// mark as final.
- return {_shardKeyToDocumentKeyFields(metadata->getKeyPatternFields()), true};
+ return {_shardKeyToDocumentKeyFields(collDesc.getKeyPatternFields()), true};
}
Status ShardServerProcessInterface::insert(const boost::intrusive_ptr<ExpressionContext>& expCtx,