Mark several more methods const

This commit is contained in:
sfc-gh-tclinkenbeard 2022-11-13 15:15:44 -08:00 committed by Trevor Clinkenbeard
parent c9968f5c0c
commit ec615181ce
6 changed files with 8 additions and 7 deletions

View File

@ -2175,7 +2175,7 @@ void DatabaseContext::removeWatch() {
ASSERT(outstandingWatches >= 0);
}
Future<Void> DatabaseContext::onConnected() {
Future<Void> DatabaseContext::onConnected() const {
return connected;
}

View File

@ -353,8 +353,9 @@ public:
int apiVersionAtLeast(int minVersion) const { return apiVersion.version() >= minVersion; }
Future<Void> onConnected(); // Returns after a majority of coordination servers are available and have reported a
// leader. The cluster file therefore is valid, but the database might be unavailable.
Future<Void> onConnected()
const; // Returns after a majority of coordination servers are available and have reported a
// leader. The cluster file therefore is valid, but the database might be unavailable.
Reference<IClusterConnectionRecord> getConnectionRecord();
// Switch the database to use the new connection file, and recreate all pending watches for committed transactions.

View File

@ -515,7 +515,7 @@ public:
void setRequestStreamEndpoint(const Endpoint& endpoint) { queue->requestStreamEndpoint = endpoint; }
bool connected() { return queue->acknowledgements.getRawEndpoint().isValid() || queue->error.isValid(); }
bool connected() const { return queue->acknowledgements.getRawEndpoint().isValid() || queue->error.isValid(); }
Future<Void> onConnected() {
if (connected()) {

View File

@ -531,7 +531,7 @@ struct LeaderRegisterCollection {
return Void();
}
Future<Void> onError() { return actors.getResult(); }
Future<Void> onError() const { return actors.getResult(); }
// Check if the this coordinator is no longer the leader, and the new one was stored in the "forward" keyspace.
// If the "forward" keyspace was set some time ago (as configured by knob), log an error to indicate the client is

View File

@ -341,7 +341,7 @@ public:
BindPromise(BindPromise const& r) : p(r.p), errContext(r.errContext), errID(r.errID) {}
BindPromise(BindPromise&& r) noexcept : p(std::move(r.p)), errContext(r.errContext), errID(r.errID) {}
Future<Void> getFuture() { return p.getFuture(); }
Future<Void> getFuture() const { return p.getFuture(); }
void operator()(const boost::system::error_code& error, size_t bytesWritten = 0) {
try {

View File

@ -1832,7 +1832,7 @@ public:
return true;
}
bool isError() {
bool isError() const {
for (int i = 0; i < futures.size(); i++)
if (futures[i].isError())
return true;