26#ifndef MYSQLROUTER_METADATA_CACHE_INCLUDED
27#define MYSQLROUTER_METADATA_CACHE_INCLUDED
42#include <rapidjson/document.h>
77 :
std::runtime_error(what_arg) {}
98 const bool md_servers_reachable,
99 const uint64_t view_id) = 0;
215 std::chrono::milliseconds
ttl;
268 const std::string &clusterset_id,
276 bool use_cluster_notifications =
false,
const uint64_t view_id = 0) = 0;
283 virtual
bool fetch_whole_topology() const = 0;
284 virtual
void fetch_whole_topology(
bool val) = 0;
291 virtual
void cache_start() = 0;
296 virtual
void cache_stop() noexcept = 0;
322 virtual
bool wait_primary_failover(const
std::
string &primary_server_uuid,
349 virtual
void add_acceptor_handler_listener(
358 virtual
void remove_acceptor_handler_listener(
366 virtual
void add_md_refresh_listener(
375 virtual
void remove_md_refresh_listener(
389 get_rest_user_auth_data(const
std::
string &username) const = 0;
395 virtual
void enable_fetch_auth_metadata() = 0;
400 virtual
void force_cache_update() = 0;
410 virtual
void check_auth_metadata_timers() const = 0;
415 virtual
void handle_sockets_acceptors_on_md_refresh() = 0;
437 virtual std::chrono::milliseconds
ttl()
const = 0;
443 const bool use_cluster_notifications,
unsigned view_id)>;
457 const unsigned view_id);
464 const unsigned router_id,
const std::string &clusterset_id,
471 size_t thread_stack_size,
bool use_cluster_notifications,
472 const uint64_t view_id)
override;
476 void instance_name(
const std::string &inst_name)
override;
477 std::string instance_name()
const override;
480 std::chrono::milliseconds ttl()
const override;
483 void cache_start()
override;
485 void cache_stop() noexcept override;
490 bool wait_primary_failover(const
std::
string &primary_server_uuid,
497 void add_acceptor_handler_listener(
500 void remove_acceptor_handler_listener(
503 void add_md_refresh_listener(
506 void remove_md_refresh_listener(
509 RefreshStatus get_refresh_status() override;
512 get_rest_user_auth_data(const
std::
string &
user) const override;
514 void enable_fetch_auth_metadata() override;
515 void force_cache_update() override;
516 void check_auth_metadata_timers() const override;
518 void handle_sockets_acceptors_on_md_refresh() override;
521 instance_factory_ = std::move(cb);
524 bool fetch_whole_topology()
const override;
525 void fetch_whole_topology(
bool val)
override;
535 std::atomic<bool> is_initialized_{
false};
Monitor pattern.
Definition: monitor.h:39
static constexpr int kDefaultReadTimeout
Definition: mysql_session.h:157
static constexpr int kDefaultConnectTimeout
Definition: mysql_session.h:156
Definition: cluster_metadata.h:159
Define rapidjson::SizeType to be std::uint64_t.
char * user
Definition: mysqladmin.cc:66
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
static const size_t kDefaultStackSizeInKiloBytes
Definition: mysql_router_thread.h:44
ClusterType
Definition: cluster_metadata.h:140
Definition: my_rapidjson_size_t.h:38
Definition: gcs_xcom_synode.h:64
SSL connection related options.
Definition: datatypes.h:34
double seconds()
Definition: task.cc:310