26#ifndef MYSQLROUTER_METADATA_CACHE_INCLUDED
27#define MYSQLROUTER_METADATA_CACHE_INCLUDED
42#include <rapidjson/document.h>
72 "_disconnect_existing_sessions_when_hidden"};
82 :
std::runtime_error(what_arg) {}
103 const bool md_servers_reachable,
104 const uint64_t view_id) = 0;
220 std::chrono::milliseconds
ttl;
273 const std::string &clusterset_id,
281 bool use_cluster_notifications =
false,
const uint64_t view_id = 0) = 0;
288 virtual
bool fetch_whole_topology() const = 0;
289 virtual
void fetch_whole_topology(
bool val) = 0;
296 virtual
void cache_start() = 0;
301 virtual
void cache_stop() noexcept = 0;
327 virtual
bool wait_primary_failover(const
std::
string &primary_server_uuid,
354 virtual
void add_acceptor_handler_listener(
363 virtual
void remove_acceptor_handler_listener(
371 virtual
void add_md_refresh_listener(
380 virtual
void remove_md_refresh_listener(
394 get_rest_user_auth_data(const
std::
string &username) const = 0;
400 virtual
void enable_fetch_auth_metadata() = 0;
405 virtual
void force_cache_update() = 0;
415 virtual
void check_auth_metadata_timers() const = 0;
420 virtual
void handle_sockets_acceptors_on_md_refresh() = 0;
442 virtual std::chrono::milliseconds
ttl()
const = 0;
448 const bool use_cluster_notifications,
unsigned view_id)>;
462 const unsigned view_id);
469 const unsigned router_id,
const std::string &clusterset_id,
476 size_t thread_stack_size,
bool use_cluster_notifications,
477 const uint64_t view_id)
override;
481 void instance_name(
const std::string &inst_name)
override;
482 std::string instance_name()
const override;
485 std::chrono::milliseconds ttl()
const override;
488 void cache_start()
override;
490 void cache_stop() noexcept override;
495 bool wait_primary_failover(const
std::
string &primary_server_uuid,
502 void add_acceptor_handler_listener(
505 void remove_acceptor_handler_listener(
508 void add_md_refresh_listener(
511 void remove_md_refresh_listener(
514 RefreshStatus get_refresh_status() override;
517 get_rest_user_auth_data(const
std::
string &
user) const override;
519 void enable_fetch_auth_metadata() override;
520 void force_cache_update() override;
521 void check_auth_metadata_timers() const override;
523 void handle_sockets_acceptors_on_md_refresh() override;
526 instance_factory_ = std::move(cb);
529 bool fetch_whole_topology()
const override;
530 void fetch_whole_topology(
bool val)
override;
540 std::atomic<bool> is_initialized_{
false};
Monitor pattern.
Definition: monitor.h:39
static constexpr int kDefaultReadTimeout
Definition: mysql_session.h:156
static constexpr int kDefaultConnectTimeout
Definition: mysql_session.h:155
Definition: cluster_metadata.h:161
Define rapidjson::SizeType to be std::size_t.
char * user
Definition: mysqladmin.cc:60
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
static const size_t kDefaultStackSizeInKiloBytes
Definition: mysql_router_thread.h:44
ClusterType
Definition: cluster_metadata.h:141
Definition: my_rapidjson_size_t.h:38
Definition: gcs_xcom_synode.h:64
SSL connection related options.
Definition: datatypes.h:39
double seconds()
Definition: task.cc:310