From 410fee677ce07be063d9cb84335085ad36742f09 Mon Sep 17 00:00:00 2001 From: Lamont Nelson Date: Fri, 21 Feb 2020 18:15:00 -0500 Subject: format; patch compiles --- src/mongo/client/sdam/topology_description.cpp | 2 +- src/mongo/client/server_is_master_monitor.cpp | 5 ++-- .../client/streamable_replica_set_monitor.cpp | 31 ++++++++++++---------- ...eamable_replica_set_monitor_query_processor.cpp | 3 ++- ...treamable_replica_set_monitor_query_processor.h | 5 ++-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/mongo/client/sdam/topology_description.cpp b/src/mongo/client/sdam/topology_description.cpp index f236f388e90..ecf5a2b389d 100644 --- a/src/mongo/client/sdam/topology_description.cpp +++ b/src/mongo/client/sdam/topology_description.cpp @@ -184,7 +184,7 @@ void TopologyDescription::checkWireCompatibilityVersions() { const std::string TopologyDescription::minimumRequiredMongoVersionString(int version) { switch (version) { - case RESUMABLE_INITIAL_SYNC: + case RESUMABLE_INITIAL_SYNC: return "4.4"; case SHARDED_TRANSACTIONS: return "4.2"; diff --git a/src/mongo/client/server_is_master_monitor.cpp b/src/mongo/client/server_is_master_monitor.cpp index 8ae85924058..1ae1c7e1682 100644 --- a/src/mongo/client/server_is_master_monitor.cpp +++ b/src/mongo/client/server_is_master_monitor.cpp @@ -29,8 +29,8 @@ #include "mongo/client/server_is_master_monitor.h" #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault -#include "mongo/client/sdam/sdam.h" #include "mongo/client/replica_set_monitor.h" +#include "mongo/client/sdam/sdam.h" #include "mongo/executor/network_interface_factory.h" #include "mongo/executor/network_interface_thread_pool.h" #include "mongo/executor/thread_pool_task_executor.h" @@ -245,7 +245,8 @@ void SingleServerIsMasterMonitor::_onIsMasterFailure(sdam::IsMasterRTT latency, Milliseconds SingleServerIsMasterMonitor::_overrideRefreshPeriod(Milliseconds original) { Milliseconds r = original; static constexpr auto kPeriodField = "period"_sd; - if (auto modifyReplicaSetMonitorDefaultRefreshPeriod = globalFailPointRegistry().find("modifyReplicaSetMonitorDefaultRefreshPeriod")) { + if (auto modifyReplicaSetMonitorDefaultRefreshPeriod = + globalFailPointRegistry().find("modifyReplicaSetMonitorDefaultRefreshPeriod")) { modifyReplicaSetMonitorDefaultRefreshPeriod->executeIf( [&r](const BSONObj& data) { r = duration_cast(Seconds{data.getIntField(kPeriodField)}); diff --git a/src/mongo/client/streamable_replica_set_monitor.cpp b/src/mongo/client/streamable_replica_set_monitor.cpp index f497648c82a..abe5e23f3dd 100644 --- a/src/mongo/client/streamable_replica_set_monitor.cpp +++ b/src/mongo/client/streamable_replica_set_monitor.cpp @@ -129,7 +129,7 @@ StreamableReplicaSetMonitor::StreamableReplicaSetMonitor(const MongoURI& uri, st } ReplicaSetMonitorPtr StreamableReplicaSetMonitor::make(const MongoURI& uri, - std::shared_ptr executor) { + std::shared_ptr executor) { auto result = std::make_shared(uri, executor); result->init(); return result; @@ -170,8 +170,8 @@ void StreamableReplicaSetMonitor::drop() { LOG(kDefaultLogLevel) << _logPrefix() << "Done closing Replica Set Monitor"; } -SemiFuture StreamableReplicaSetMonitor::getHostOrRefresh(const ReadPreferenceSetting& criteria, - Milliseconds maxWait) { +SemiFuture StreamableReplicaSetMonitor::getHostOrRefresh( + const ReadPreferenceSetting& criteria, Milliseconds maxWait) { return getHostsOrRefresh(criteria, maxWait) .thenRunOn(_executor) .then([self = shared_from_this()](const std::vector& result) { @@ -301,7 +301,9 @@ void StreamableReplicaSetMonitor::failedHost(const HostAndPort& host, const Stat failedHost(host, BSONObj(), status); } -void StreamableReplicaSetMonitor::failedHost(const HostAndPort& host, BSONObj bson, const Status& status) { +void StreamableReplicaSetMonitor::failedHost(const HostAndPort& host, + BSONObj bson, + const Status& status) { IsMasterOutcome outcome(host.toString(), bson, status.toString()); _topologyManager->onServerDescription(outcome); } @@ -472,27 +474,27 @@ void StreamableReplicaSetMonitor::onTopologyDescriptionChangedEvent( } void StreamableReplicaSetMonitor::onServerHeartbeatSucceededEvent(sdam::IsMasterRTT durationMs, - const ServerAddress& hostAndPort, - const BSONObj reply) { + const ServerAddress& hostAndPort, + const BSONObj reply) { IsMasterOutcome outcome(hostAndPort, reply, durationMs); _topologyManager->onServerDescription(outcome); } void StreamableReplicaSetMonitor::onServerHeartbeatFailureEvent(IsMasterRTT durationMs, - Status errorStatus, - const ServerAddress& hostAndPort, - const BSONObj reply) { + Status errorStatus, + const ServerAddress& hostAndPort, + const BSONObj reply) { IsMasterOutcome outcome(hostAndPort, reply, errorStatus.toString()); _topologyManager->onServerDescription(outcome); } void StreamableReplicaSetMonitor::onServerPingFailedEvent(const ServerAddress& hostAndPort, - const Status& status) { + const Status& status) { failedHost(HostAndPort(hostAndPort), status); } void StreamableReplicaSetMonitor::onServerPingSucceededEvent(sdam::IsMasterRTT durationMS, - const ServerAddress& hostAndPort) { + const ServerAddress& hostAndPort) { _topologyManager->onServerRTTUpdated(hostAndPort, durationMS); } @@ -512,8 +514,8 @@ void StreamableReplicaSetMonitor::_failOutstandingWithStatus(WithLock, Status st _outstandingQueries.clear(); } -bool StreamableReplicaSetMonitor::_hasMembershipChange(sdam::TopologyDescriptionPtr oldDescription, - sdam::TopologyDescriptionPtr newDescription) { +bool StreamableReplicaSetMonitor::_hasMembershipChange( + sdam::TopologyDescriptionPtr oldDescription, sdam::TopologyDescriptionPtr newDescription) { if (oldDescription->getServers().size() != newDescription->getServers().size()) return true; @@ -537,7 +539,8 @@ bool StreamableReplicaSetMonitor::_hasMembershipChange(sdam::TopologyDescription return false; } -void StreamableReplicaSetMonitor::_processOutstanding(const TopologyDescriptionPtr& topologyDescription) { +void StreamableReplicaSetMonitor::_processOutstanding( + const TopologyDescriptionPtr& topologyDescription) { // TODO: refactor so that we don't call _getHost(s) for every outstanding query // since there might be duplicates. stdx::lock_guard lock(_mutex); diff --git a/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp b/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp index 5cadf92266f..2cb0633036d 100644 --- a/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp +++ b/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp @@ -52,7 +52,8 @@ void StreamableReplicaSetMonitor::StreamableReplicaSetMonitorQueryProcessor:: const auto& setName = newDescription->getSetName(); if (setName) { - auto replicaSetMonitor = std::static_pointer_cast(globalRSMonitorManager.getMonitor(*setName)); + auto replicaSetMonitor = std::static_pointer_cast( + globalRSMonitorManager.getMonitor(*setName)); if (!replicaSetMonitor) { LOG(kLogLevel) << "could not find rsm instance " << *setName << " for query processing."; diff --git a/src/mongo/client/streamable_replica_set_monitor_query_processor.h b/src/mongo/client/streamable_replica_set_monitor_query_processor.h index bac2d42cc45..839db06adf7 100644 --- a/src/mongo/client/streamable_replica_set_monitor_query_processor.h +++ b/src/mongo/client/streamable_replica_set_monitor_query_processor.h @@ -28,11 +28,12 @@ */ #pragma once -#include "mongo/client/streamable_replica_set_monitor.h" #include "mongo/client/sdam/sdam.h" +#include "mongo/client/streamable_replica_set_monitor.h" namespace mongo { -class StreamableReplicaSetMonitor::StreamableReplicaSetMonitorQueryProcessor final : public sdam::TopologyListener { +class StreamableReplicaSetMonitor::StreamableReplicaSetMonitorQueryProcessor final + : public sdam::TopologyListener { public: void shutdown(); -- cgit v1.2.1