forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_data.cc
More file actions
28 lines (24 loc) · 797 Bytes
/
client_data.cc
File metadata and controls
28 lines (24 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (C) 2019-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#include "client_data.hh"
#include <stdexcept>
sstring to_string(client_type ct) {
switch (ct) {
case client_type::cql: return "cql";
case client_type::thrift: return "thrift";
case client_type::alternator: return "alternator";
}
throw std::runtime_error("Invalid client_type");
}
sstring to_string(client_connection_stage ccs) {
switch (ccs) {
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");
}