Files
scylladb/gms/application_state.hh
Kefu Chai 005d231f96 db: add formatter for gms::application_state
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for `gms::application_state`,
but its operator<< is preserved, as it is still used by the generic
homebrew formatter for `std::unordered_map<>`.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#17096
2024-02-01 10:02:25 +02:00

53 lines
987 B
C++

/*
*
* Modified by ScyllaDB
* Copyright (C) 2015-present ScyllaDB
*/
/*
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
*/
#pragma once
#include <iosfwd>
#include <fmt/core.h>
namespace gms {
enum class application_state {
STATUS = 0,
LOAD,
SCHEMA,
DC,
RACK,
RELEASE_VERSION,
REMOVAL_COORDINATOR,
INTERNAL_IP,
RPC_ADDRESS,
X_11_PADDING, // padding specifically for 1.1
SEVERITY,
NET_VERSION,
HOST_ID,
TOKENS,
SUPPORTED_FEATURES,
CACHE_HITRATES,
SCHEMA_TABLES_VERSION,
RPC_READY,
VIEW_BACKLOG,
SHARD_COUNT,
IGNORE_MSB_BITS,
CDC_GENERATION_ID,
SNITCH_NAME,
};
std::ostream& operator<<(std::ostream& os, const application_state& m);
}
template <>
struct fmt::formatter<gms::application_state> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
auto format(gms::application_state, fmt::format_context& ctx) const -> decltype(ctx.out());
};