summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_rs.cpp
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2014-01-30 18:02:10 -0500
committerEric Milkie <milkie@10gen.com>2014-01-30 18:02:18 -0500
commit751f1101967da3593431f1b41a37867ccb169901 (patch)
treee0bad32ad8a71bb6aacf10030ceda5bedcfb7568 /src/mongo/client/dbclient_rs.cpp
parent0455a09b22d2e5fc7d0fa47e0fd8f83a9d3e03e6 (diff)
downloadmongo-751f1101967da3593431f1b41a37867ccb169901.tar.gz
SERVER-12419 switch to using a post-command hook to capture gle information
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r--src/mongo/client/dbclient_rs.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index f4a15b59af1..a34080f39d2 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -183,6 +183,18 @@ namespace {
_runCommandHook = func;
}
+ void DBClientReplicaSet::setPostRunCommandHook
+ (DBClientWithCommands::PostRunCommandHookFunc func) {
+ // Set the hooks in both our sub-connections and in ourselves.
+ if (_master) {
+ _master->setPostRunCommandHook(func);
+ }
+ if (_lastSlaveOkConn) {
+ _lastSlaveOkConn->setPostRunCommandHook(func);
+ }
+ _postRunCommandHook = func;
+ }
+
// A replica set connection is never disconnected, since it controls its own reconnection
// logic.
//
@@ -297,6 +309,7 @@ namespace {
_master.reset(newConn);
_master->setReplSetClientCallback(this);
_master->setRunCommandHook(_runCommandHook);
+ _master->setPostRunCommandHook(_postRunCommandHook);
_auth( _master.get() );
return _master.get();
@@ -679,6 +692,7 @@ namespace {
_lastSlaveOkConn.reset(newConn);
_lastSlaveOkConn->setReplSetClientCallback(this);
_lastSlaveOkConn->setRunCommandHook(_runCommandHook);
+ _lastSlaveOkConn->setPostRunCommandHook(_postRunCommandHook);
_auth(_lastSlaveOkConn.get());