summaryrefslogtreecommitdiff
path: root/src/mongo/client/sdam
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/sdam')
-rw-r--r--src/mongo/client/sdam/sdam_datatypes.h8
-rw-r--r--src/mongo/client/sdam/server_description.h9
-rw-r--r--src/mongo/client/sdam/server_description_builder.h12
-rw-r--r--src/mongo/client/sdam/server_selector.h8
-rw-r--r--src/mongo/client/sdam/topology_listener.h9
-rw-r--r--src/mongo/client/sdam/topology_listener_mock.h5
-rw-r--r--src/mongo/client/sdam/topology_state_machine.h2
7 files changed, 25 insertions, 28 deletions
diff --git a/src/mongo/client/sdam/sdam_datatypes.h b/src/mongo/client/sdam/sdam_datatypes.h
index 111f149d4f1..cf9a471079a 100644
--- a/src/mongo/client/sdam/sdam_datatypes.h
+++ b/src/mongo/client/sdam/sdam_datatypes.h
@@ -54,9 +54,9 @@ enum class TopologyType {
kUnknown
};
const std::vector<TopologyType> allTopologyTypes();
-std::string toString(const TopologyType topologyType);
+std::string toString(TopologyType topologyType);
StatusWith<TopologyType> parseTopologyType(StringData strTopologyType);
-std::ostream& operator<<(std::ostream& os, const TopologyType topologyType);
+std::ostream& operator<<(std::ostream& os, TopologyType topologyType);
enum class ServerType {
kStandalone,
@@ -69,9 +69,9 @@ enum class ServerType {
kUnknown
};
const std::vector<ServerType> allServerTypes();
-std::string toString(const ServerType serverType);
+std::string toString(ServerType serverType);
StatusWith<ServerType> parseServerType(StringData strServerType);
-std::ostream& operator<<(std::ostream& os, const ServerType serverType);
+std::ostream& operator<<(std::ostream& os, ServerType serverType);
using HelloRTT = Microseconds;
diff --git a/src/mongo/client/sdam/server_description.h b/src/mongo/client/sdam/server_description.h
index e9674cc1332..a8d5f256542 100644
--- a/src/mongo/client/sdam/server_description.h
+++ b/src/mongo/client/sdam/server_description.h
@@ -119,14 +119,13 @@ private:
void parseTypeFromHelloReply(BSONObj helloReply);
- void calculateRtt(const boost::optional<HelloRTT> currentRtt,
- const boost::optional<HelloRTT> lastRtt);
+ void calculateRtt(boost::optional<HelloRTT> currentRtt, boost::optional<HelloRTT> lastRtt);
void saveLastWriteInfo(BSONObj lastWriteBson);
- void storeHostListIfPresent(const std::string key,
- const BSONObj response,
+ void storeHostListIfPresent(std::string key,
+ BSONObj response,
std::set<HostAndPort>& destination);
- void saveHosts(const BSONObj response);
+ void saveHosts(BSONObj response);
void saveTags(BSONObj tagsObj);
void saveElectionId(BSONElement electionId);
void saveTopologyVersion(BSONElement topologyVersionField);
diff --git a/src/mongo/client/sdam/server_description_builder.h b/src/mongo/client/sdam/server_description_builder.h
index b0e886d4e90..d1cd53a6f06 100644
--- a/src/mongo/client/sdam/server_description_builder.h
+++ b/src/mongo/client/sdam/server_description_builder.h
@@ -46,16 +46,16 @@ public:
// server identity
ServerDescriptionBuilder& withAddress(const HostAndPort& address);
- ServerDescriptionBuilder& withType(const ServerType type);
+ ServerDescriptionBuilder& withType(ServerType type);
ServerDescriptionBuilder& withMe(const HostAndPort& me);
- ServerDescriptionBuilder& withTag(const std::string key, const std::string value);
- ServerDescriptionBuilder& withSetName(const std::string setName);
+ ServerDescriptionBuilder& withTag(std::string key, std::string value);
+ ServerDescriptionBuilder& withSetName(std::string setName);
// network attributes
ServerDescriptionBuilder& withRtt(const HelloRTT& rtt);
ServerDescriptionBuilder& withError(const std::string& error);
ServerDescriptionBuilder& withLogicalSessionTimeoutMinutes(
- const boost::optional<int> logicalSessionTimeoutMinutes);
+ boost::optional<int> logicalSessionTimeoutMinutes);
// server capabilities
ServerDescriptionBuilder& withMinWireVersion(int minVersion);
@@ -63,7 +63,7 @@ public:
// server 'time'
ServerDescriptionBuilder& withLastWriteDate(const Date_t& lastWriteDate);
- ServerDescriptionBuilder& withOpTime(const repl::OpTime opTime);
+ ServerDescriptionBuilder& withOpTime(repl::OpTime opTime);
ServerDescriptionBuilder& withLastUpdateTime(const Date_t& lastUpdateTime);
// topology membership
@@ -71,7 +71,7 @@ public:
ServerDescriptionBuilder& withHost(const HostAndPort& host);
ServerDescriptionBuilder& withPassive(const HostAndPort& passive);
ServerDescriptionBuilder& withArbiter(const HostAndPort& arbiter);
- ServerDescriptionBuilder& withSetVersion(const int setVersion);
+ ServerDescriptionBuilder& withSetVersion(int setVersion);
ServerDescriptionBuilder& withElectionId(const OID& electionId);
ServerDescriptionBuilder& withTopologyVersion(TopologyVersion topologyVersion);
diff --git a/src/mongo/client/sdam/server_selector.h b/src/mongo/client/sdam/server_selector.h
index ed60e32cc34..65a1047fbdb 100644
--- a/src/mongo/client/sdam/server_selector.h
+++ b/src/mongo/client/sdam/server_selector.h
@@ -57,7 +57,7 @@ public:
* ServerDescription(s). The server is selected randomly from those that match the criteria.
*/
virtual boost::optional<ServerDescriptionPtr> selectServer(
- const TopologyDescriptionPtr topologyDescription,
+ TopologyDescriptionPtr topologyDescription,
const ReadPreferenceSetting& criteria,
const std::vector<HostAndPort>& excludedHosts = std::vector<HostAndPort>()) = 0;
@@ -70,12 +70,12 @@ public:
explicit SdamServerSelector(const SdamConfiguration& config);
boost::optional<std::vector<ServerDescriptionPtr>> selectServers(
- const TopologyDescriptionPtr topologyDescription,
+ TopologyDescriptionPtr topologyDescription,
const ReadPreferenceSetting& criteria,
const std::vector<HostAndPort>& excludedHosts = std::vector<HostAndPort>()) override;
boost::optional<ServerDescriptionPtr> selectServer(
- const TopologyDescriptionPtr topologyDescription,
+ TopologyDescriptionPtr topologyDescription,
const ReadPreferenceSetting& criteria,
const std::vector<HostAndPort>& excludedHosts = std::vector<HostAndPort>()) override;
@@ -84,7 +84,7 @@ public:
private:
void _getCandidateServers(std::vector<ServerDescriptionPtr>* result,
- const TopologyDescriptionPtr topologyDescription,
+ TopologyDescriptionPtr topologyDescription,
const ReadPreferenceSetting& criteria,
const std::vector<HostAndPort>& excludedHosts);
diff --git a/src/mongo/client/sdam/topology_listener.h b/src/mongo/client/sdam/topology_listener.h
index 29b976cdf3f..f99ed84ba75 100644
--- a/src/mongo/client/sdam/topology_listener.h
+++ b/src/mongo/client/sdam/topology_listener.h
@@ -104,17 +104,16 @@ public:
TopologyDescriptionPtr newDescription) override;
virtual void onServerHandshakeCompleteEvent(HelloRTT duration,
const HostAndPort& address,
- const BSONObj reply = BSONObj()) override;
+ BSONObj reply = BSONObj()) override;
void onServerHandshakeFailedEvent(const HostAndPort& address,
const Status& status,
- const BSONObj reply);
+ BSONObj reply);
- void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort,
- const BSONObj reply) override;
+ void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort, BSONObj reply) override;
void onServerHeartbeatFailureEvent(Status errorStatus,
const HostAndPort& hostAndPort,
- const BSONObj reply) override;
+ BSONObj reply) override;
void onServerPingFailedEvent(const HostAndPort& hostAndPort, const Status& status) override;
void onServerPingSucceededEvent(HelloRTT duration, const HostAndPort& hostAndPort) override;
diff --git a/src/mongo/client/sdam/topology_listener_mock.h b/src/mongo/client/sdam/topology_listener_mock.h
index 051d56ee589..ad8db6f46da 100644
--- a/src/mongo/client/sdam/topology_listener_mock.h
+++ b/src/mongo/client/sdam/topology_listener_mock.h
@@ -40,12 +40,11 @@ public:
TopologyListenerMock() = default;
virtual ~TopologyListenerMock() = default;
- void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort,
- const BSONObj reply) override;
+ void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort, BSONObj reply) override;
void onServerHeartbeatFailureEvent(Status errorStatus,
const HostAndPort& hostAndPort,
- const BSONObj reply) override;
+ BSONObj reply) override;
/**
* Returns true if _serverIsMasterReplies contains an element corresponding to hostAndPort.
diff --git a/src/mongo/client/sdam/topology_state_machine.h b/src/mongo/client/sdam/topology_state_machine.h
index 5c631123887..c946de9c0e3 100644
--- a/src/mongo/client/sdam/topology_state_machine.h
+++ b/src/mongo/client/sdam/topology_state_machine.h
@@ -89,7 +89,7 @@ private:
ServerDescriptionPtr newServerDescription,
bool newServer);
void removeServerDescription(TopologyDescription& topologyDescription,
- const HostAndPort serverAddress);
+ HostAndPort serverAddress);
void modifyTopologyType(TopologyDescription& topologyDescription, TopologyType topologyType);
void modifySetName(TopologyDescription& topologyDescription,