diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-09 16:25:42 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-15 13:26:14 -0400 |
commit | 1249034444dc146eb6177fbe4845e593b807f84d (patch) | |
tree | 68eaa1b22e33c89e73f7fac06ce5644f5990825e /src/mongo/db/fts | |
parent | b3aaf2e5809e272367b0f60f66938d8bf712702c (diff) | |
download | mongo-1249034444dc146eb6177fbe4845e593b807f84d.tar.gz |
SERVER-13498 Get rid of LockStatus
This change removes all usages of LockStatus and pushes the lock
acquisitions to be inside the respective commands. This is a
refactoring on the way to per-document locking.
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/fts_command.h | 2 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_command_mongod.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_command_mongos.cpp | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/mongo/db/fts/fts_command.h b/src/mongo/db/fts/fts_command.h index 81a4a3d6043..d340c8b60d1 100644 --- a/src/mongo/db/fts/fts_command.h +++ b/src/mongo/db/fts/fts_command.h @@ -49,7 +49,7 @@ namespace mongo { bool slaveOk() const { return true; } bool slaveOverrideOk() const { return true; } - LockType locktype() const; + virtual bool isWriteCommandForConfigServer() const { return false; } void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/fts/fts_command_mongod.cpp b/src/mongo/db/fts/fts_command_mongod.cpp index b01205a23c8..7240d587a7c 100644 --- a/src/mongo/db/fts/fts_command_mongod.cpp +++ b/src/mongo/db/fts/fts_command_mongod.cpp @@ -30,6 +30,7 @@ #include <string> +#include "mongo/db/client.h" #include "mongo/db/fts/fts_command.h" #include "mongo/db/fts/fts_util.h" #include "mongo/db/pdfile.h" @@ -42,10 +43,6 @@ namespace mongo { namespace fts { - Command::LockType FTSCommand::locktype() const { - return READ; - } - /* * Runs the command object cmdobj on the db with name dbname and puts result in result. * @param dbname, name of db @@ -94,6 +91,8 @@ namespace mongo { projBob.appendElements(sortSpec); BSONObj projObj = projBob.obj(); + Client::ReadContext ctx(ns); + CanonicalQuery* cq; Status canonicalizeStatus = CanonicalQuery::canonicalize(ns, queryObj, sortSpec, projObj, 0, limit, BSONObj(), diff --git a/src/mongo/db/fts/fts_command_mongos.cpp b/src/mongo/db/fts/fts_command_mongos.cpp index 4f39eb1543f..0c0f09e957b 100644 --- a/src/mongo/db/fts/fts_command_mongos.cpp +++ b/src/mongo/db/fts/fts_command_mongos.cpp @@ -54,10 +54,6 @@ namespace mongo { double score; }; - - // all grid commands are designed not to lock - Command::LockType FTSCommand::locktype() const { return NONE; } - bool FTSCommand::_run(const string& dbName, BSONObj& cmdObj, int cmdOptions, |