diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-06 14:40:59 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-14 17:50:41 -0500 |
commit | 950fa6e6fd8f46248796dea3bc6c2392757b163d (patch) | |
tree | 2556f9322ee634477fc54b6876653b8ea702b8fa /src/mongo/db/repl/sync_source_resolver.cpp | |
parent | d2eedbeeedb61753c17b6a87912e4b14e7611b95 (diff) | |
download | mongo-950fa6e6fd8f46248796dea3bc6c2392757b163d.tar.gz |
SERVER-32070 migrate some easy stdx::bind to lambdas (pt3)
Diffstat (limited to 'src/mongo/db/repl/sync_source_resolver.cpp')
-rw-r--r-- | src/mongo/db/repl/sync_source_resolver.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/mongo/db/repl/sync_source_resolver.cpp b/src/mongo/db/repl/sync_source_resolver.cpp index f95e5ae5aeb..f66f26c4cd4 100644 --- a/src/mongo/db/repl/sync_source_resolver.cpp +++ b/src/mongo/db/repl/sync_source_resolver.cpp @@ -173,11 +173,11 @@ std::unique_ptr<Fetcher> SyncSourceResolver::_makeFirstOplogEntryFetcher( << BSON(OplogEntryBase::kTimestampFieldName << 1 << OplogEntryBase::kTermFieldName << 1)), - stdx::bind(&SyncSourceResolver::_firstOplogEntryFetcherCallback, - this, - stdx::placeholders::_1, - candidate, - earliestOpTimeSeen), + [=](const StatusWith<Fetcher::QueryResponse>& response, + Fetcher::NextAction*, + BSONObjBuilder*) { + return _firstOplogEntryFetcherCallback(response, candidate, earliestOpTimeSeen); + }, ReadPreferenceSetting::secondaryPreferredMetadata(), kFetcherTimeout /* find network timeout */, kFetcherTimeout /* getMore network timeout */); @@ -195,12 +195,11 @@ std::unique_ptr<Fetcher> SyncSourceResolver::_makeRequiredOpTimeFetcher(HostAndP BSON("find" << kLocalOplogNss.coll() << "oplogReplay" << true << "filter" << BSON("ts" << BSON("$gte" << _requiredOpTime.getTimestamp() << "$lte" << _requiredOpTime.getTimestamp()))), - stdx::bind(&SyncSourceResolver::_requiredOpTimeFetcherCallback, - this, - stdx::placeholders::_1, - candidate, - earliestOpTimeSeen, - rbid), + [=](const StatusWith<Fetcher::QueryResponse>& response, + Fetcher::NextAction*, + BSONObjBuilder*) { + return _requiredOpTimeFetcherCallback(response, candidate, earliestOpTimeSeen, rbid); + }, ReadPreferenceSetting::secondaryPreferredMetadata(), kFetcherTimeout /* find network timeout */, kFetcherTimeout /* getMore network timeout */); @@ -354,12 +353,9 @@ Status SyncSourceResolver::_scheduleRBIDRequest(HostAndPort candidate, OpTime ea invariant(_state == State::kRunning); auto handle = _taskExecutor->scheduleRemoteCommand( {candidate, "admin", BSON("replSetGetRBID" << 1), nullptr, kFetcherTimeout}, - stdx::bind(&SyncSourceResolver::_rbidRequestCallback, - this, - candidate, - earliestOpTimeSeen, - stdx::placeholders::_1)); - + [=](const executor::TaskExecutor::RemoteCommandCallbackArgs& rbidReply) { + _rbidRequestCallback(candidate, earliestOpTimeSeen, rbidReply); + }); if (!handle.isOK()) { return handle.getStatus(); } |