summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_find.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-08-15 18:31:16 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-08-16 08:03:40 -0400
commit80801195df6055d4ba7f6f9c2bee2530cc87010d (patch)
tree99acb4ab77af39d8d58dd1ad13b4d6d2f98c30ae /src/mongo/s/query/cluster_find.cpp
parente668a59876a0a61fdeb272966b4954fe4ed40d42 (diff)
downloadmongo-80801195df6055d4ba7f6f9c2bee2530cc87010d.tar.gz
SERVER-18084 Add Grid::get(ServiceContext*) getter
Also removes some references to the static 'grid' instance.
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r--src/mongo/s/query/cluster_find.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp
index 38fc7af2fa5..7d8b12260a7 100644
--- a/src/mongo/s/query/cluster_find.cpp
+++ b/src/mongo/s/query/cluster_find.cpp
@@ -152,7 +152,7 @@ StatusWith<CursorId> runQueryWithoutRetrying(OperationContext* txn,
std::shared_ptr<Shard> primary,
std::vector<BSONObj>* results,
BSONObj* viewDefinition) {
- auto shardRegistry = grid.shardRegistry();
+ auto shardRegistry = Grid::get(txn)->shardRegistry();
// Get the set of shards on which we will run the query.
std::vector<std::shared_ptr<Shard>> shards;
@@ -284,7 +284,7 @@ StatusWith<CursorId> runQueryWithoutRetrying(OperationContext* txn,
}
// Register the cursor with the cursor manager.
- auto cursorManager = grid.getCursorManager();
+ auto cursorManager = Grid::get(txn)->getCursorManager();
const auto cursorType = chunkManager ? ClusterCursorManager::CursorType::NamespaceSharded
: ClusterCursorManager::CursorType::NamespaceNotSharded;
const auto cursorLifetime = query.getQueryRequest().isNoCursorTimeout()
@@ -314,7 +314,7 @@ StatusWith<CursorId> ClusterFind::runQuery(OperationContext* txn,
<< query.getQueryRequest().getProj()};
}
- auto dbConfig = grid.catalogCache()->getDatabase(txn, query.nss().db().toString());
+ auto dbConfig = Grid::get(txn)->catalogCache()->getDatabase(txn, query.nss().db().toString());
if (dbConfig.getStatus() == ErrorCodes::NamespaceNotFound) {
// If the database doesn't exist, we successfully return an empty result set without
// creating a cursor.
@@ -372,7 +372,7 @@ StatusWith<CursorId> ClusterFind::runQuery(OperationContext* txn,
StatusWith<CursorResponse> ClusterFind::runGetMore(OperationContext* txn,
const GetMoreRequest& request) {
- auto cursorManager = grid.getCursorManager();
+ auto cursorManager = Grid::get(txn)->getCursorManager();
auto pinnedCursor = cursorManager->checkOutCursor(request.nss, request.cursorid, txn);
if (!pinnedCursor.isOK()) {