diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-04-21 10:19:03 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-04-21 10:44:55 -0400 |
commit | c7ca036edec9caa276b502164903023c767cf637 (patch) | |
tree | 2b3cd22675ed5cd0e38f1b621b5cabbf8d325a61 /src/mongo/s/commands/commands_public.cpp | |
parent | 9dcb30e21814a36c43a795f9d8d2b5a117a99a31 (diff) | |
download | mongo-c7ca036edec9caa276b502164903023c767cf637.tar.gz |
SERVER-23480 make Command::parseNsCollectionRequired and oplog.cpp's parseNs return NamespaceString
Diffstat (limited to 'src/mongo/s/commands/commands_public.cpp')
-rw-r--r-- | src/mongo/s/commands/commands_public.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index 8e248b45d49..f15d63d65b4 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -430,14 +430,14 @@ public: int options, string& errmsg, BSONObjBuilder& output) { - const string ns = parseNsCollectionRequired(dbName, cmdObj); + const NamespaceString nss = parseNsCollectionRequired(dbName, cmdObj); auto conf = uassertStatusOK(grid.catalogCache()->getDatabase(txn, dbName)); - if (!conf->isShardingEnabled() || !conf->isSharded(ns)) { + if (!conf->isShardingEnabled() || !conf->isSharded(nss.ns())) { return passthrough(txn, conf, cmdObj, output); } - ChunkManagerPtr cm = conf->getChunkManager(txn, ns); + ChunkManagerPtr cm = conf->getChunkManager(txn, nss.ns()); massert(40051, "chunk manager should not be null", cm); vector<Strategy::CommandResult> results; @@ -552,20 +552,20 @@ public: return appendCommandStatus(result, status.getStatus()); } - const string fullns = dbName + "." + cmdObj.firstElement().valuestrsafe(); + const NamespaceString fullns = parseNsCollectionRequired(dbName, cmdObj); log() << "DROP: " << fullns; const auto& db = status.getValue(); - if (!db->isShardingEnabled() || !db->isSharded(fullns)) { + if (!db->isShardingEnabled() || !db->isSharded(fullns.ns())) { log() << "\tdrop going to do passthrough"; return passthrough(txn, db, cmdObj, result); } - uassertStatusOK(grid.catalogManager(txn)->dropCollection(txn, NamespaceString(fullns))); + uassertStatusOK(grid.catalogManager(txn)->dropCollection(txn, fullns)); // Force a full reload next time the just dropped namespace is accessed - db->invalidateNs(fullns); + db->invalidateNs(fullns.ns()); return true; } |