diff options
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/dbclient_cursor.h | 2 | ||||
-rw-r--r-- | src/mongo/client/mongo_uri.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/mongo_uri.h | 2 | ||||
-rw-r--r-- | src/mongo/client/sdam/mock_topology_manager.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/sdam/mock_topology_manager.h | 2 | ||||
-rw-r--r-- | src/mongo/client/sdam/sdam_datatypes.cpp | 4 | ||||
-rw-r--r-- | src/mongo/client/sdam/sdam_datatypes.h | 4 | ||||
-rw-r--r-- | src/mongo/client/sdam/server_description.cpp | 6 | ||||
-rw-r--r-- | src/mongo/client/sdam/server_description.h | 6 | ||||
-rw-r--r-- | src/mongo/client/sdam/topology_description.cpp | 4 | ||||
-rw-r--r-- | src/mongo/client/sdam/topology_description.h | 4 | ||||
-rw-r--r-- | src/mongo/client/sdam/topology_manager.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/sdam/topology_manager.h | 4 | ||||
-rw-r--r-- | src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.h | 2 |
15 files changed, 24 insertions, 24 deletions
diff --git a/src/mongo/client/dbclient_cursor.h b/src/mongo/client/dbclient_cursor.h index ad8eba20d77..520b1c1236c 100644 --- a/src/mongo/client/dbclient_cursor.h +++ b/src/mongo/client/dbclient_cursor.h @@ -390,7 +390,7 @@ public: return _c.getNamespaceString(); } - const long long getCursorId() const { + long long getCursorId() const { return _c.getCursorId(); } diff --git a/src/mongo/client/mongo_uri.cpp b/src/mongo/client/mongo_uri.cpp index fe125a4f060..835bfe51b92 100644 --- a/src/mongo/client/mongo_uri.cpp +++ b/src/mongo/client/mongo_uri.cpp @@ -533,7 +533,7 @@ StatusWith<MongoURI> MongoURI::parse(StringData url) try { return exceptionToStatus(); } -const boost::optional<std::string> MongoURI::getAppName() const { +boost::optional<std::string> MongoURI::getAppName() const { const auto optIter = _options.find("appName"); if (optIter != end(_options)) { return optIter->second; diff --git a/src/mongo/client/mongo_uri.h b/src/mongo/client/mongo_uri.h index 0118073f495..741ddf869c8 100644 --- a/src/mongo/client/mongo_uri.h +++ b/src/mongo/client/mongo_uri.h @@ -233,7 +233,7 @@ public: } - const boost::optional<std::string> getAppName() const; + boost::optional<std::string> getAppName() const; std::string canonicalizeURIAsString() const; diff --git a/src/mongo/client/sdam/mock_topology_manager.cpp b/src/mongo/client/sdam/mock_topology_manager.cpp index da01ff515bd..b45ccc57a7d 100644 --- a/src/mongo/client/sdam/mock_topology_manager.cpp +++ b/src/mongo/client/sdam/mock_topology_manager.cpp @@ -46,7 +46,7 @@ bool MockTopologyManager::onServerDescription(const HelloOutcome& helloOutcome) return true; } -const std::shared_ptr<TopologyDescription> MockTopologyManager::getTopologyDescription() const { +std::shared_ptr<TopologyDescription> MockTopologyManager::getTopologyDescription() const { stdx::lock_guard<mongo::Mutex> lock(_mutex); return _topologyDescription; } diff --git a/src/mongo/client/sdam/mock_topology_manager.h b/src/mongo/client/sdam/mock_topology_manager.h index e0827f6a422..c12afc758f2 100644 --- a/src/mongo/client/sdam/mock_topology_manager.h +++ b/src/mongo/client/sdam/mock_topology_manager.h @@ -42,7 +42,7 @@ public: void onServerRTTUpdated(HostAndPort hostAndPort, HelloRTT rtt) override; void setTopologyDescription(TopologyDescriptionPtr newDescription); - const TopologyDescriptionPtr getTopologyDescription() const override; + TopologyDescriptionPtr getTopologyDescription() const override; SemiFuture<std::vector<HostAndPort>> executeWithLock( std::function<SemiFuture<std::vector<HostAndPort>>(const TopologyDescriptionPtr&)> func) diff --git a/src/mongo/client/sdam/sdam_datatypes.cpp b/src/mongo/client/sdam/sdam_datatypes.cpp index 78e86bc3fae..3efea4140cb 100644 --- a/src/mongo/client/sdam/sdam_datatypes.cpp +++ b/src/mongo/client/sdam/sdam_datatypes.cpp @@ -83,7 +83,7 @@ std::ostream& operator<<(std::ostream& os, const ServerType serverType) { return os; } -const std::vector<ServerType> allServerTypes() { +std::vector<ServerType> allServerTypes() { static auto const result = std::vector<ServerType>{ServerType::kStandalone, ServerType::kMongos, ServerType::kRSPrimary, @@ -136,7 +136,7 @@ std::ostream& operator<<(std::ostream& os, const TopologyType topologyType) { return os; } -const std::vector<TopologyType> allTopologyTypes() { +std::vector<TopologyType> allTopologyTypes() { static auto const result = std::vector<TopologyType>{TopologyType::kSingle, TopologyType::kReplicaSetNoPrimary, TopologyType::kReplicaSetWithPrimary, diff --git a/src/mongo/client/sdam/sdam_datatypes.h b/src/mongo/client/sdam/sdam_datatypes.h index cf9a471079a..eae4bc4767a 100644 --- a/src/mongo/client/sdam/sdam_datatypes.h +++ b/src/mongo/client/sdam/sdam_datatypes.h @@ -53,7 +53,7 @@ enum class TopologyType { kSharded, kUnknown }; -const std::vector<TopologyType> allTopologyTypes(); +std::vector<TopologyType> allTopologyTypes(); std::string toString(TopologyType topologyType); StatusWith<TopologyType> parseTopologyType(StringData strTopologyType); std::ostream& operator<<(std::ostream& os, TopologyType topologyType); @@ -68,7 +68,7 @@ enum class ServerType { kRSGhost, kUnknown }; -const std::vector<ServerType> allServerTypes(); +std::vector<ServerType> allServerTypes(); std::string toString(ServerType serverType); StatusWith<ServerType> parseServerType(StringData strServerType); std::ostream& operator<<(std::ostream& os, ServerType serverType); diff --git a/src/mongo/client/sdam/server_description.cpp b/src/mongo/client/sdam/server_description.cpp index babe5d1a777..0fbba4dd33b 100644 --- a/src/mongo/client/sdam/server_description.cpp +++ b/src/mongo/client/sdam/server_description.cpp @@ -277,7 +277,7 @@ const boost::optional<std::string>& ServerDescription::getSetName() const { return _setName; } -const ElectionIdSetVersionPair ServerDescription::getElectionIdSetVersionPair() const { +ElectionIdSetVersionPair ServerDescription::getElectionIdSetVersionPair() const { return ElectionIdSetVersionPair{_electionId, _setVersion}; } @@ -285,7 +285,7 @@ const boost::optional<HostAndPort>& ServerDescription::getPrimary() const { return _primary; } -const mongo::Date_t ServerDescription::getLastUpdateTime() const { +mongo::Date_t ServerDescription::getLastUpdateTime() const { return *_lastUpdateTime; } @@ -436,7 +436,7 @@ ServerDescriptionPtr ServerDescription::cloneWithRTT(HelloRTT rtt) { return newServerDescription; } -const boost::optional<TopologyDescriptionPtr> ServerDescription::getTopologyDescription() { +boost::optional<TopologyDescriptionPtr> ServerDescription::getTopologyDescription() { if (_topologyDescription) { const auto result = _topologyDescription->lock(); invariant(result); diff --git a/src/mongo/client/sdam/server_description.h b/src/mongo/client/sdam/server_description.h index 4a7505a0973..0be4cfa426c 100644 --- a/src/mongo/client/sdam/server_description.h +++ b/src/mongo/client/sdam/server_description.h @@ -94,7 +94,7 @@ public: bool isDataBearingServer() const; // server 'time' - const Date_t getLastUpdateTime() const; + Date_t getLastUpdateTime() const; const boost::optional<Date_t>& getLastWriteDate() const; const boost::optional<repl::OpTime>& getOpTime() const; @@ -103,9 +103,9 @@ public: const std::set<HostAndPort>& getHosts() const; const std::set<HostAndPort>& getPassives() const; const std::set<HostAndPort>& getArbiters() const; - const ElectionIdSetVersionPair getElectionIdSetVersionPair() const; + ElectionIdSetVersionPair getElectionIdSetVersionPair() const; const boost::optional<TopologyVersion>& getTopologyVersion() const; - const boost::optional<TopologyDescriptionPtr> getTopologyDescription(); + boost::optional<TopologyDescriptionPtr> getTopologyDescription(); BSONObj toBson() const; std::string toString() const; diff --git a/src/mongo/client/sdam/topology_description.cpp b/src/mongo/client/sdam/topology_description.cpp index 9dd586f8a18..63ba155a3d8 100644 --- a/src/mongo/client/sdam/topology_description.cpp +++ b/src/mongo/client/sdam/topology_description.cpp @@ -141,7 +141,7 @@ std::vector<ServerDescriptionPtr> TopologyDescription::findServers( return result; } -const boost::optional<ServerDescriptionPtr> TopologyDescription::findServerByAddress( +boost::optional<ServerDescriptionPtr> TopologyDescription::findServerByAddress( HostAndPort address) const { auto results = findServers([address](const ServerDescriptionPtr& serverDescription) { return serverDescription->getAddress() == address; @@ -223,7 +223,7 @@ void TopologyDescription::checkWireCompatibilityVersions() { _compatibleError = (_compatible) ? boost::none : boost::make_optional(errorOss.str()); } -const std::string TopologyDescription::minimumRequiredMongoVersionString(int version) { +std::string TopologyDescription::minimumRequiredMongoVersionString(int version) { switch (version) { case RESUMABLE_INITIAL_SYNC: return "4.4"; diff --git a/src/mongo/client/sdam/topology_description.h b/src/mongo/client/sdam/topology_description.h index d8799356513..88da2d8b388 100644 --- a/src/mongo/client/sdam/topology_description.h +++ b/src/mongo/client/sdam/topology_description.h @@ -77,7 +77,7 @@ public: const boost::optional<int>& getLogicalSessionTimeoutMinutes() const; const Milliseconds& getHeartBeatFrequency() const; - const boost::optional<ServerDescriptionPtr> findServerByAddress(HostAndPort address) const; + boost::optional<ServerDescriptionPtr> findServerByAddress(HostAndPort address) const; bool containsServerAddress(const HostAndPort& address) const; std::vector<ServerDescriptionPtr> findServers( std::function<bool(const ServerDescriptionPtr&)> predicate) const; @@ -128,7 +128,7 @@ private: * Source: * https://github.com/mongodb/specifications/blob/master/source/wireversion-featurelist.rst */ - const std::string minimumRequiredMongoVersionString(int version); + std::string minimumRequiredMongoVersionString(int version); /** * From Server Discovery and Monitoring: diff --git a/src/mongo/client/sdam/topology_manager.cpp b/src/mongo/client/sdam/topology_manager.cpp index abd0dfc5e5b..f52fcc32330 100644 --- a/src/mongo/client/sdam/topology_manager.cpp +++ b/src/mongo/client/sdam/topology_manager.cpp @@ -116,7 +116,7 @@ bool TopologyManagerImpl::onServerDescription(const HelloOutcome& helloOutcome) return true; } -const std::shared_ptr<TopologyDescription> TopologyManagerImpl::getTopologyDescription() const { +std::shared_ptr<TopologyDescription> TopologyManagerImpl::getTopologyDescription() const { stdx::lock_guard<mongo::Mutex> lock(_mutex); return _topologyDescription; } diff --git a/src/mongo/client/sdam/topology_manager.h b/src/mongo/client/sdam/topology_manager.h index 3544144c911..6f70e327008 100644 --- a/src/mongo/client/sdam/topology_manager.h +++ b/src/mongo/client/sdam/topology_manager.h @@ -44,7 +44,7 @@ public: virtual void onServerRTTUpdated(HostAndPort hostAndPort, HelloRTT rtt) = 0; - virtual const TopologyDescriptionPtr getTopologyDescription() const = 0; + virtual TopologyDescriptionPtr getTopologyDescription() const = 0; virtual SemiFuture<std::vector<HostAndPort>> executeWithLock( std::function<SemiFuture<std::vector<HostAndPort>>(const TopologyDescriptionPtr&)> @@ -92,7 +92,7 @@ public: /** * Get the current TopologyDescription. This is safe to call from multiple threads. */ - const TopologyDescriptionPtr getTopologyDescription() const override; + TopologyDescriptionPtr getTopologyDescription() const override; /** * Executes the given function with the current TopologyDescription while holding the mutex. diff --git a/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.cpp b/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.cpp index 53ad894f94e..7a914b99985 100644 --- a/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.cpp +++ b/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.cpp @@ -58,7 +58,7 @@ void StreamableReplicaSetMonitor::StreamableReplicaSetMonitorDiscoveryTimeProces _elapsedTime.reset(); } } -const Milliseconds StreamableReplicaSetMonitor::StreamableReplicaSetMonitorDiscoveryTimeProcessor:: +Milliseconds StreamableReplicaSetMonitor::StreamableReplicaSetMonitorDiscoveryTimeProcessor:: getPrimaryServerChangeElapsedTime() const { stdx::lock_guard lock(_mutex); return Milliseconds(_elapsedTime.millis()); diff --git a/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.h b/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.h index ab786a5cb73..494c9e82fcc 100644 --- a/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.h +++ b/src/mongo/client/streamable_replica_set_monitor_discovery_time_processor.h @@ -38,7 +38,7 @@ public: void onTopologyDescriptionChangedEvent(sdam::TopologyDescriptionPtr previousDescription, sdam::TopologyDescriptionPtr newDescription) override; - const Milliseconds getPrimaryServerChangeElapsedTime() const; + Milliseconds getPrimaryServerChangeElapsedTime() const; private: mutable Mutex _mutex = |