Files
scylla/locator/types.hh
Petr Gusev c9fbe3d377 locator: make dc_rack_fn a template
In the next commits token_metadata will be
made a template with NodeId=inet_address|host_id
parameter. This parameter will be passed to dc_rack_fn
function, so it also should be made a template.
2023-12-11 12:51:33 +04:00

38 lines
719 B
C++

/*
*
* Modified by ScyllaDB
* Copyright (C) 2022-present ScyllaDB
*/
/*
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
*/
#pragma once
#include <seastar/core/sstring.hh>
#include "gms/inet_address.hh"
#include "locator/host_id.hh"
using namespace seastar;
namespace locator {
using inet_address = gms::inet_address;
// Endpoint Data Center and Rack names
struct endpoint_dc_rack {
sstring dc;
sstring rack;
static thread_local const endpoint_dc_rack default_location;
bool operator==(const endpoint_dc_rack&) const = default;
};
template <typename NodeId>
using dc_rack_fn = seastar::noncopyable_function<std::optional<endpoint_dc_rack>(NodeId)>;
} // namespace locator