diff options
author | Misha Tyulenev <misha@mongodb.com> | 2017-02-08 14:18:29 -0500 |
---|---|---|
committer | Misha Tyulenev <misha@mongodb.com> | 2017-02-08 15:51:51 -0500 |
commit | 437352cd7dbc158343e2929888d265928b6ca8b7 (patch) | |
tree | 5ba458038de0aa6c1616f0322dd6289cc527b6ad /src/mongo/db/logical_clock.cpp | |
parent | 24c073e764e6d0ee199c1748be19898f798aeb15 (diff) | |
download | mongo-437352cd7dbc158343e2929888d265928b6ca8b7.tar.gz |
SERVER-27828: Pass ServiceContext to oplog and ReplicationCoordinator methods that will use LogicalClock
Diffstat (limited to 'src/mongo/db/logical_clock.cpp')
-rw-r--r-- | src/mongo/db/logical_clock.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/logical_clock.cpp b/src/mongo/db/logical_clock.cpp index c712941dee5..ad61792045b 100644 --- a/src/mongo/db/logical_clock.cpp +++ b/src/mongo/db/logical_clock.cpp @@ -53,12 +53,10 @@ void LogicalClock::set(ServiceContext* service, std::unique_ptr<LogicalClock> cl clock = std::move(clockArg); } -LogicalClock::LogicalClock(ServiceContext* serviceContext, +LogicalClock::LogicalClock(ServiceContext* service, std::unique_ptr<TimeProofService> tps, bool validateProof) - : _serviceContext(serviceContext), - _timeProofService(std::move(tps)), - _validateProof(validateProof) {} + : _service(service), _timeProofService(std::move(tps)), _validateProof(validateProof) {} SignedLogicalTime LogicalClock::getClusterTime() { stdx::lock_guard<stdx::mutex> lock(_mutex); @@ -94,7 +92,7 @@ LogicalTime LogicalClock::reserveTicks(uint64_t ticks) { stdx::lock_guard<stdx::mutex> lock(_mutex); const unsigned wallClockSecs = - durationCount<Seconds>(_serviceContext->getFastClockSource()->now().toDurationSinceEpoch()); + durationCount<Seconds>(_service->getFastClockSource()->now().toDurationSinceEpoch()); unsigned currentSecs = _clusterTime.getTime().asTimestamp().getSecs(); LogicalTime clusterTimestamp = _clusterTime.getTime(); |