summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_find.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2021-03-24 14:07:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-02 21:51:14 +0000
commitea51edf33aa685e8b8d4692ee42b8c0e8e9cfb98 (patch)
treea3866340e9e80201eb9c9b675200700cc30ad53d /src/mongo/s/query/cluster_find.cpp
parent0198bcfb938ccd788f90a2f5e6156871cf18330f (diff)
downloadmongo-ea51edf33aa685e8b8d4692ee42b8c0e8e9cfb98.tar.gz
SERVER-54975 Rename IDL parser classes to use CommandRequest and CommandReply suffixes
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r--src/mongo/s/query/cluster_find.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp
index 8997ee6746b..f8e9c420f37 100644
--- a/src/mongo/s/query/cluster_find.cpp
+++ b/src/mongo/s/query/cluster_find.cpp
@@ -84,11 +84,11 @@ static const int kPerDocumentOverheadBytesUpperBound = 10;
const char kFindCmdName[] = "find";
/**
- * Given the FindCommand 'findCommand' being executed by mongos, returns a copy of the query which
- * is suitable for forwarding to the targeted hosts.
+ * Given the FindCommandRequest 'findCommand' being executed by mongos, returns a copy of the query
+ * which is suitable for forwarding to the targeted hosts.
*/
-StatusWith<std::unique_ptr<FindCommand>> transformQueryForShards(
- const FindCommand& findCommand, bool appendGeoNearDistanceProjection) {
+StatusWith<std::unique_ptr<FindCommandRequest>> transformQueryForShards(
+ const FindCommandRequest& findCommand, bool appendGeoNearDistanceProjection) {
// If there is a limit, we forward the sum of the limit and the skip.
boost::optional<int64_t> newLimit;
if (findCommand.getLimit()) {
@@ -156,7 +156,7 @@ StatusWith<std::unique_ptr<FindCommand>> transformQueryForShards(
newProjection = projectionBuilder.obj();
}
- auto newQR = std::make_unique<FindCommand>(findCommand);
+ auto newQR = std::make_unique<FindCommandRequest>(findCommand);
newQR->setProjection(newProjection);
newQR->setSkip(boost::none);
newQR->setLimit(newLimit);
@@ -171,7 +171,7 @@ StatusWith<std::unique_ptr<FindCommand>> transformQueryForShards(
if (newQR->getShowRecordId())
newQR->setShowRecordId(false);
- uassertStatusOK(query_request_helper::validateFindCommand(*newQR));
+ uassertStatusOK(query_request_helper::validateFindCommandRequest(*newQR));
return std::move(newQR);
}
@@ -186,14 +186,14 @@ std::vector<std::pair<ShardId, BSONObj>> constructRequestsForShards(
const CanonicalQuery& query,
bool appendGeoNearDistanceProjection) {
- std::unique_ptr<FindCommand> findCommandToForward;
+ std::unique_ptr<FindCommandRequest> findCommandToForward;
if (shardIds.size() > 1) {
- findCommandToForward = uassertStatusOK(
- transformQueryForShards(query.getFindCommand(), appendGeoNearDistanceProjection));
+ findCommandToForward = uassertStatusOK(transformQueryForShards(
+ query.getFindCommandRequest(), appendGeoNearDistanceProjection));
} else {
- // Forwards the FindCommand as is to a single shard so that limit and skip can
+ // Forwards the FindCommandRequest as is to a single shard so that limit and skip can
// be applied on mongod.
- findCommandToForward = std::make_unique<FindCommand>(query.getFindCommand());
+ findCommandToForward = std::make_unique<FindCommandRequest>(query.getFindCommandRequest());
}
auto& readConcernArgs = repl::ReadConcernArgs::get(opCtx);
@@ -248,7 +248,7 @@ CursorId runQueryWithoutRetrying(OperationContext* opCtx,
const ChunkManager& cm,
std::vector<BSONObj>* results,
bool* partialResultsReturned) {
- auto findCommand = query.getFindCommand();
+ auto findCommand = query.getFindCommandRequest();
// Get the set of shards on which we will run the query.
auto shardIds = getTargetedShardsForQuery(
query.getExpCtx(), cm, findCommand.getFilter(), findCommand.getCollation());
@@ -438,7 +438,7 @@ CursorId runQueryWithoutRetrying(OperationContext* opCtx,
* and/or what's specified on the request.
*/
Status setUpOperationContextStateForGetMore(OperationContext* opCtx,
- const GetMoreCommand& cmd,
+ const GetMoreCommandRequest& cmd,
const ClusterCursorManager::PinnedCursor& cursor) {
if (auto readPref = cursor->getReadPreference()) {
ReadPreferenceSetting::get(opCtx) = *readPref;
@@ -494,7 +494,7 @@ CursorId ClusterFind::runQuery(OperationContext* opCtx,
// We must always have a BSONObj vector into which to output our results.
invariant(results);
- auto findCommand = query.getFindCommand();
+ auto findCommand = query.getFindCommandRequest();
// Projection on the reserved sort key field is illegal in mongos.
if (findCommand.getProjection().hasField(AsyncResultsMerger::kSortKeyField)) {
uasserted(ErrorCodes::BadValue,
@@ -689,7 +689,7 @@ void validateOperationSessionInfo(OperationContext* opCtx,
}
StatusWith<CursorResponse> ClusterFind::runGetMore(OperationContext* opCtx,
- const GetMoreCommand& cmd) {
+ const GetMoreCommandRequest& cmd) {
auto cursorManager = Grid::get(opCtx)->getCursorManager();
auto authzSession = AuthorizationSession::get(opCtx->getClient());