diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
commit | fefb1e355f6cbe35160f2f73ed68a38d95fa59a2 (patch) | |
tree | faecb2fb6677516c5f6d9edfae8475344ddd73ed /s/writeback_listener.h | |
parent | d95b46b2bbb5b4246213f252010508489b4e5719 (diff) | |
parent | 64b33ee522375a8dc15be2875dfb7db4502259b0 (diff) | |
download | mongodb-fefb1e355f6cbe35160f2f73ed68a38d95fa59a2.tar.gz |
Merge commit 'upstream/1.8.2'
Diffstat (limited to 's/writeback_listener.h')
-rw-r--r-- | s/writeback_listener.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/s/writeback_listener.h b/s/writeback_listener.h index 7335999..0125073 100644 --- a/s/writeback_listener.h +++ b/s/writeback_listener.h @@ -35,10 +35,30 @@ namespace mongo { */ class WriteBackListener : public BackgroundJob { public: + + class ConnectionIdent { + public: + ConnectionIdent( const string& ii , ConnectionId id ) + : instanceIdent( ii ) , connectionId( id ) { + } + + bool operator<(const ConnectionIdent& other) const { + if ( instanceIdent == other.instanceIdent ) + return connectionId < other.connectionId; + + return instanceIdent < other.instanceIdent; + } + + string toString() const { return str::stream() << instanceIdent << ":" << connectionId; } + + string instanceIdent; + ConnectionId connectionId; + }; + static void init( DBClientBase& conn ); static void init( const string& host ); - static BSONObj waitFor( ConnectionId connectionId, const OID& oid ); + static BSONObj waitFor( const ConnectionIdent& ident, const OID& oid ); protected: WriteBackListener( const string& addr ); @@ -59,7 +79,7 @@ namespace mongo { }; static mongo::mutex _seenWritebacksLock; // protects _seenWritbacks - static map<ConnectionId,WBStatus> _seenWritebacks; // connectionId -> last write back GLE + static map<ConnectionIdent,WBStatus> _seenWritebacks; // connectionId -> last write back GLE }; void waitForWriteback( const OID& oid ); |