Now, when the user logs in and the connection becomes authenticated, the processing loop of the connection is switched to the scheduling group that corresponds to the service level assigned to the logged in user. The scheduling group is also updated when the service level assigned to this user changes. Starting from this commit, the scheduling groups managed by the service level controller are actually being used by user workload.
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2019-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
#pragma once
|
|
|
|
#include <seastar/net/inet_address.hh>
|
|
#include <seastar/core/sstring.hh>
|
|
#include "seastarx.hh"
|
|
|
|
#include <optional>
|
|
|
|
enum class client_type {
|
|
cql = 0,
|
|
thrift,
|
|
alternator,
|
|
};
|
|
|
|
sstring to_string(client_type ct);
|
|
|
|
enum class client_connection_stage {
|
|
established = 0,
|
|
authenticating,
|
|
ready,
|
|
};
|
|
|
|
sstring to_string(client_connection_stage ct);
|
|
|
|
// Representation of a row in `system.clients'. std::optionals are for nullable cells.
|
|
struct client_data {
|
|
net::inet_address ip;
|
|
int32_t port;
|
|
client_type ct = client_type::cql;
|
|
client_connection_stage connection_stage = client_connection_stage::established;
|
|
int32_t shard_id; /// ID of server-side shard which is processing the connection.
|
|
|
|
std::optional<sstring> driver_name;
|
|
std::optional<sstring> driver_version;
|
|
std::optional<sstring> hostname;
|
|
std::optional<int32_t> protocol_version;
|
|
std::optional<sstring> ssl_cipher_suite;
|
|
std::optional<bool> ssl_enabled;
|
|
std::optional<sstring> ssl_protocol;
|
|
std::optional<sstring> username;
|
|
std::optional<sstring> scheduling_group_name;
|
|
|
|
sstring stage_str() const { return to_string(connection_stage); }
|
|
sstring client_type_str() const { return to_string(ct); }
|
|
};
|