mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
uuid: reduce code dependency on UUID_gen.hh
Do not include UUID_gen.hh in trace_state.hh and lists.hh to reduce header level dependency on it. Message-Id: <20210127173114.725761-2-kostja@scylladb.com>
This commit is contained in:
committed by
Avi Kivity
parent
a1f93e4297
commit
b4f875f08e
@@ -48,6 +48,7 @@
|
||||
#include "cql3/untyped_result_set.hh"
|
||||
#include "log.hh"
|
||||
#include "utils/rjson.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
#include "types.hh"
|
||||
#include "concrete_types.hh"
|
||||
#include "types/listlike_partial_deserializing_iterator.hh"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "constants.hh"
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
#include "types/list.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
|
||||
namespace cql3 {
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
|
||||
#include "cql3/abstract_marker.hh"
|
||||
#include "to_string.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
#include "operation.hh"
|
||||
|
||||
namespace cql3 {
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <seastar/core/shared_ptr.hh>
|
||||
#include <seastar/core/execution_stage.hh>
|
||||
#include <seastar/net/byteorder.hh>
|
||||
#include "utils/UUID_gen.hh"
|
||||
#include "utils/UUID.hh"
|
||||
#include "utils/hash.hh"
|
||||
#include "db_clock.hh"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "canonical_mutation.hh"
|
||||
#include "db/schema_tables.hh"
|
||||
#include "hashers.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
|
||||
schema_mutations::schema_mutations(canonical_mutation columnfamilies,
|
||||
canonical_mutation columns,
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "utils/managed_bytes.hh"
|
||||
#include "utils/logalloc.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
#include "row_cache.hh"
|
||||
#include "log.hh"
|
||||
#include "schema_builder.hh"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "cql3/cql_config.hh"
|
||||
#include "types/set.hh"
|
||||
#include "types/map.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
|
||||
namespace tracing {
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
#include "cql3/values.hh"
|
||||
#include "cql3/query_options.hh"
|
||||
#include "utils/UUID_gen.hh"
|
||||
|
||||
namespace tracing {
|
||||
|
||||
@@ -76,6 +77,32 @@ void trace_state::params_values_deleter::operator()(params_values* pv) {
|
||||
delete pv;
|
||||
}
|
||||
|
||||
void trace_state::init_session_records(
|
||||
trace_type type,
|
||||
std::chrono::seconds slow_query_ttl,
|
||||
std::optional<utils::UUID> session_id,
|
||||
span_id parent_id) {
|
||||
|
||||
_records = make_lw_shared<one_session_records>();
|
||||
_records->session_id = session_id ? *session_id : utils::UUID_gen::get_time_UUID();
|
||||
|
||||
if (full_tracing()) {
|
||||
if (!log_slow_query()) {
|
||||
_records->ttl = ttl_by_type(type);
|
||||
} else {
|
||||
_records->ttl = std::max(ttl_by_type(type), slow_query_ttl);
|
||||
}
|
||||
} else {
|
||||
_records->ttl = slow_query_ttl;
|
||||
}
|
||||
|
||||
_records->session_rec.command = type;
|
||||
_records->session_rec.slow_query_record_ttl = slow_query_ttl;
|
||||
_records->my_span_id = span_id::make_span_id();
|
||||
_records->parent_id = parent_id;
|
||||
}
|
||||
|
||||
|
||||
void trace_state::set_batchlog_endpoints(const std::unordered_set<gms::inet_address>& val) {
|
||||
_params_ptr->batchlog_endpoints.emplace(val);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include <seastar/util/lazy.hh>
|
||||
#include <seastar/core/weak_ptr.hh>
|
||||
#include <seastar/core/checked_ptr.hh>
|
||||
#include "utils/UUID_gen.hh"
|
||||
#include "tracing/tracing.hh"
|
||||
#include "gms/inet_address.hh"
|
||||
#include "auth/authenticated_user.hh"
|
||||
@@ -235,25 +234,9 @@ private:
|
||||
return log_slow_query() && e > _slow_query_threshold;
|
||||
}
|
||||
|
||||
void init_session_records(trace_type type, std::chrono::seconds slow_query_ttl, std::optional<utils::UUID> session_id = std::nullopt, span_id parent_id = span_id::illegal_id) {
|
||||
_records = make_lw_shared<one_session_records>();
|
||||
_records->session_id = session_id ? *session_id : utils::UUID_gen::get_time_UUID();
|
||||
|
||||
if (full_tracing()) {
|
||||
if (!log_slow_query()) {
|
||||
_records->ttl = ttl_by_type(type);
|
||||
} else {
|
||||
_records->ttl = std::max(ttl_by_type(type), slow_query_ttl);
|
||||
}
|
||||
} else {
|
||||
_records->ttl = slow_query_ttl;
|
||||
}
|
||||
|
||||
_records->session_rec.command = type;
|
||||
_records->session_rec.slow_query_record_ttl = slow_query_ttl;
|
||||
_records->my_span_id = span_id::make_span_id();
|
||||
_records->parent_id = parent_id;
|
||||
}
|
||||
void init_session_records(trace_type type, std::chrono::seconds slow_query_ttl,
|
||||
std::optional<utils::UUID> session_id = std::nullopt,
|
||||
span_id parent_id = span_id::illegal_id);
|
||||
|
||||
bool should_write_records() const {
|
||||
return full_tracing() || _records->do_log_slow_query;
|
||||
|
||||
Reference in New Issue
Block a user