diff options
author | Spencer T Brody <spencer@10gen.com> | 2012-11-29 18:35:12 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2012-11-30 13:49:05 -0500 |
commit | 0413def714cd2471eb25c30e8f7b62728d26207b (patch) | |
tree | f2ca24e69ab5e98cb30bd584a7e342aec64776b1 /src/mongo/s/cursors.h | |
parent | 95fffadc1c33333c53313f9da2b7a952aeb9f044 (diff) | |
download | mongo-0413def714cd2471eb25c30e8f7b62728d26207b.tar.gz |
Store cursor namespaces in mongos. Necessary so mongos can check authorization on the cursor's ns in killcursors. SERVER-7572
Diffstat (limited to 'src/mongo/s/cursors.h')
-rw-r--r-- | src/mongo/s/cursors.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/s/cursors.h b/src/mongo/s/cursors.h index 6b42fc928d1..8666d2d5497 100644 --- a/src/mongo/s/cursors.h +++ b/src/mongo/s/cursors.h @@ -20,6 +20,8 @@ #include "mongo/pch.h" +#include <string> + #include "mongo/client/parallel.h" #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" @@ -100,10 +102,12 @@ namespace mongo { void store( ShardedClientCursorPtr cursor ); void remove( long long id ); - void storeRef( const string& server , long long id ); + void storeRef(const std::string& server, long long id, const std::string& ns); /** @return the server for id or "" */ string getRef( long long id ) const ; + /** @return the ns for id or "" */ + std::string getRefNS(long long id) const ; void gotKillCursors(Message& m ); @@ -119,7 +123,8 @@ namespace mongo { PseudoRandom _random; MapSharded _cursors; - MapNormal _refs; + MapNormal _refs; // Maps cursor ID to shard name + MapNormal _refsNS; // Maps cursor ID to namespace long long _shardedTotal; |