gms: remove unused operator<<

since we've switched almost all callers of the operator<< to {fmt},
let's drop the unused operator<<:s.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2024-06-18 09:08:01 +08:00
parent 51d686ea9f
commit ec5f0fccce
11 changed files with 6 additions and 41 deletions

View File

@@ -41,11 +41,6 @@ static const std::map<application_state, sstring> application_state_names = {
{application_state::SNITCH_NAME, "SNITCH_NAME"},
};
std::ostream& operator<<(std::ostream& os, const application_state& m) {
fmt::print(os, "{}", m);
return os;
}
}
auto fmt::formatter<gms::application_state>::format(gms::application_state m,

View File

@@ -10,7 +10,6 @@
#pragma once
#include <iosfwd>
#include <fmt/core.h>
namespace gms {
@@ -41,8 +40,6 @@ enum class application_state {
SNITCH_NAME,
};
std::ostream& operator<<(std::ostream& os, const application_state& m);
}
template <>

View File

@@ -36,11 +36,6 @@ const versioned_value* endpoint_state::get_application_state_ptr(application_sta
}
}
std::ostream& operator<<(std::ostream& os, const endpoint_state& x) {
fmt::print(os, "{}", x);
return os;
}
bool endpoint_state::is_cql_ready() const noexcept {
auto* app_state = get_application_state_ptr(application_state::RPC_READY);
if (!app_state) {

View File

@@ -162,8 +162,6 @@ public:
friend fmt::formatter<endpoint_state>;
};
std::ostream& operator<<(std::ostream& os, const endpoint_state& x);
using endpoint_state_ptr = lw_shared_ptr<const endpoint_state>;
inline endpoint_state_ptr make_endpoint_state_ptr(const endpoint_state& eps) {

View File

@@ -2721,11 +2721,6 @@ locator::token_metadata_ptr gossiper::get_token_metadata_ptr() const noexcept {
return _shared_token_metadata.get();
}
std::ostream& operator<<(std::ostream& os, const loaded_endpoint_state& st) {
fmt::print(os, "{}", st);
return os;
}
} // namespace gms
auto fmt::formatter<gms::loaded_endpoint_state>::format(const gms::loaded_endpoint_state& st, fmt::format_context& ctx) const -> decltype(ctx.out()) {

View File

@@ -82,8 +82,6 @@ struct loaded_endpoint_state {
std::optional<gms::versioned_value> opt_status;
};
std::ostream& operator<<(std::ostream& os, const loaded_endpoint_state& st);
/**
* This module is responsible for Gossiping information for the local endpoint. This abstraction
* maintains the list of live and dead endpoints. Periodically i.e. every 1 second this module

View File

@@ -31,8 +31,3 @@ future<gms::inet_address> gms::inet_address::lookup(sstring name, opt_family fam
return gms::inet_address(h.addr_list.front());
});
}
std::ostream& gms::operator<<(std::ostream& os, const inet_address& x) {
fmt::print(os, "{}", x);
return os;
}

View File

@@ -73,8 +73,6 @@ public:
static future<inet_address> lookup(sstring, opt_family family = {}, opt_family preferred = {});
};
std::ostream& operator<<(std::ostream& os, const inet_address& x);
}
namespace std {

View File

@@ -201,11 +201,4 @@ template <> struct fmt::formatter<gms::versioned_value> : fmt::formatter<string_
auto format(const gms::versioned_value& v, fmt::format_context& ctx) const {
return fmt::format_to(ctx.out(), "Value({},{})", v.value(), v.version());
}
};
namespace gms {
inline std::ostream& operator<<(std::ostream& os, const versioned_value& v) {
fmt::print(os, "{}", v);
return os;
}
}
};

View File

@@ -52,7 +52,7 @@ void print_natural_endpoints(double point, const inet_address_vector_replica_set
std::ostringstream strm(str);
for (auto& addr : v) {
strm<<addr<<" ";
fmt::print(strm, "{} ", addr);
}
testlog.debug("{}", strm.str());

View File

@@ -7,6 +7,9 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#define BOOST_TEST_MODULE test-serialization
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <assert.h>
#include <sstream>
@@ -16,11 +19,9 @@
#include "types/types.hh"
#include "gms/inet_address.hh"
#include "gms/inet_address_serializer.hh"
#include "test/lib/test_utils.hh"
#include "serializer_impl.hh"
#define BOOST_TEST_MODULE test-serialization
#include <boost/test/unit_test.hpp>
void show(std::stringstream &ss) {
char c;
while (ss.get(c)) {