client_data: Sanitize connection_notifier

Now the connection_notifier is all gone, only the client_data bits are left.
To keep it consistent -- rename the files.

Also, while at it, brush up the header dependencies and remove the not
really used constexprs for client states.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2022-01-21 13:18:56 +03:00
parent d63ba87266
commit de6c60c1c9
7 changed files with 10 additions and 20 deletions

View File

@@ -6,11 +6,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "connection_notifier.hh"
#include "cql3/constants.hh"
#include "replica/database.hh"
#include "service/storage_proxy.hh"
#include "client_data.hh"
#include <stdexcept>
sstring to_string(client_type ct) {
@@ -24,9 +20,9 @@ sstring to_string(client_type ct) {
sstring to_string(client_connection_stage ccs) {
switch (ccs) {
case client_connection_stage::established: return connection_stage_literal<client_connection_stage::established>;
case client_connection_stage::authenticating: return connection_stage_literal<client_connection_stage::authenticating>;
case client_connection_stage::ready: return connection_stage_literal<client_connection_stage::ready>;
case client_connection_stage::established: return "ESTABLISHED";
case client_connection_stage::authenticating: return "AUTHENTICATING";
case client_connection_stage::ready: return "READY";
}
throw std::runtime_error("Invalid client_connection_stage");
}

View File

@@ -7,8 +7,6 @@
*/
#pragma once
#include "db/query_context.hh"
#include <seastar/net/inet_address.hh>
#include <seastar/core/sstring.hh>
#include "seastarx.hh"
@@ -31,11 +29,6 @@ enum class client_connection_stage {
sstring to_string(client_connection_stage ct);
template <client_connection_stage ccs> constexpr const char* connection_stage_literal = "";
template <> inline constexpr const char* connection_stage_literal<client_connection_stage::established> = "ESTABLISHED";
template <> inline constexpr const char* connection_stage_literal<client_connection_stage::authenticating> = "AUTHENTICATING";
template <> inline constexpr const char* connection_stage_literal<client_connection_stage::ready> = "READY";
// Representation of a row in `system.clients'. std::optionals are for nullable cells.
struct client_data {
net::inet_address ip;

View File

@@ -665,7 +665,7 @@ scylla_core = (['replica/database.cc',
'atomic_cell.cc',
'caching_options.cc',
'collection_mutation.cc',
'connection_notifier.cc',
'client_data.cc',
'hashers.cc',
'schema.cc',
'frozen_schema.cc',

View File

@@ -67,6 +67,7 @@
#include "serializer_impl.hh"
#include "idl/frozen_mutation.dist.impl.hh"
#include <boost/algorithm/cxx11/any_of.hpp>
#include "client_data.hh"
using days = std::chrono::duration<int, std::ratio<24 * 3600>>;

View File

@@ -54,6 +54,7 @@
#include "message/messaging_service.hh"
#include "db/sstables-format-selector.hh"
#include "db/snapshot-ctl.hh"
#include "cql3/query_processor.hh"
#include <seastar/net/dns.hh>
#include <seastar/core/io_queue.hh>
#include <seastar/core/abort_on_ebadf.hh>
@@ -66,7 +67,6 @@
#include "replica/distributed_loader.hh"
#include "sstables_loader.hh"
#include "cql3/cql_config.hh"
#include "connection_notifier.hh"
#include "transport/controller.hh"
#include "thrift/controller.hh"
#include "service/memory_limiter.hh"

View File

@@ -11,7 +11,7 @@
#include "seastarx.hh"
#include <seastar/core/future.hh>
#include <vector>
#include "connection_notifier.hh"
#include "client_data.hh"
#include "utils/chunked_vector.hh"
struct client_data;

View File

@@ -42,8 +42,8 @@
#include "service/query_state.hh"
#include "service/client_state.hh"
#include "exceptions/exceptions.hh"
#include "connection_notifier.hh"
#include "client_data.hh"
#include "cql3/query_processor.hh"
#include "auth/authenticator.hh"
#include <cassert>