Files
scylladb/raft/raft.cc
Benny Halevy 25ebc63b82 move to_string.hh to utils/
Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-02-15 11:09:04 +02:00

31 lines
725 B
C++

/*
* Copyright (C) 2020-present ScyllaDB
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "raft.hh"
#include "utils/to_string.hh"
namespace raft {
seastar::logger logger("raft");
std::ostream& operator<<(std::ostream& os, const raft::server_address& addr) {
return os << format("{{.id={}}}", addr.id);
}
std::ostream& operator<<(std::ostream& os, const raft::config_member& s) {
return os << format("{{.id={} .can_vote={}}}", s.addr.id, s.can_vote);
}
std::ostream& operator<<(std::ostream& os, const raft::configuration& cfg) {
if (cfg.previous.empty()) {
return os << cfg.current;
}
return os << format("{}->{}", cfg.previous, cfg.current);
}
} // end of namespace raft