summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_rs.cpp
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-06-10 00:05:49 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-06-16 16:25:38 -0400
commitb6b9e3ecd726bf9c36155e2dccd67f825a95800c (patch)
tree185dc4178ddbe3352cde9a439faedd0d2e3e80fd /src/mongo/client/dbclient_rs.cpp
parent5014f223f0692ca552858d04a5efe1958c3367fb (diff)
downloadmongo-b6b9e3ecd726bf9c36155e2dccd67f825a95800c.tar.gz
SERVER-18236 make runCommandHook and postRunCommand hook operate on the metadata object
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r--src/mongo/client/dbclient_rs.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index 980e2f4fea6..2d482d4ae63 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -175,27 +175,26 @@ namespace {
return _master->getServerHostAndPort();
}
- void DBClientReplicaSet::setRunCommandHook(DBClientWithCommands::RunCommandHookFunc func) {
+ void DBClientReplicaSet::setRequestMetadataWriter(rpc::RequestMetadataWriter writer) {
// Set the hooks in both our sub-connections and in ourselves.
if (_master) {
- _master->setRunCommandHook(func);
+ _master->setRequestMetadataWriter(writer);
}
if (_lastSlaveOkConn.get()) {
- _lastSlaveOkConn->setRunCommandHook(func);
+ _lastSlaveOkConn->setRequestMetadataWriter(writer);
}
- _runCommandHook = func;
+ DBClientWithCommands::setRequestMetadataWriter(std::move(writer));
}
- void DBClientReplicaSet::setPostRunCommandHook
- (DBClientWithCommands::PostRunCommandHookFunc func) {
+ void DBClientReplicaSet::setReplyMetadataReader(rpc::ReplyMetadataReader reader) {
// Set the hooks in both our sub-connections and in ourselves.
if (_master) {
- _master->setPostRunCommandHook(func);
+ _master->setReplyMetadataReader(reader);
}
if (_lastSlaveOkConn.get()) {
- _lastSlaveOkConn->setPostRunCommandHook(func);
+ _lastSlaveOkConn->setReplyMetadataReader(reader);
}
- _postRunCommandHook = func;
+ DBClientWithCommands::setReplyMetadataReader(std::move(reader));
}
// A replica set connection is never disconnected, since it controls its own reconnection
@@ -319,8 +318,8 @@ namespace {
_masterHost = h;
_master.reset(newConn);
_master->setParentReplSetName(_setName);
- _master->setRunCommandHook(_runCommandHook);
- _master->setPostRunCommandHook(_postRunCommandHook);
+ _master->setRequestMetadataWriter(getRequestMetadataWriter());
+ _master->setReplyMetadataReader(getReplyMetadataReader());
_auth( _master.get() );
return _master.get();
@@ -723,8 +722,8 @@ namespace {
_lastSlaveOkConn.reset(newConn);
_lastSlaveOkConn->setParentReplSetName(_setName);
- _lastSlaveOkConn->setRunCommandHook(_runCommandHook);
- _lastSlaveOkConn->setPostRunCommandHook(_postRunCommandHook);
+ _lastSlaveOkConn->setRequestMetadataWriter(getRequestMetadataWriter());
+ _lastSlaveOkConn->setReplyMetadataReader(getReplyMetadataReader());
if (_authPooledSecondaryConn) {
_auth(_lastSlaveOkConn.get());