MySQL 8.0.40
Source Code Documentation
metadata_cache_plugin.cc File Reference
#include <termios.h>
#include <unistd.h>
#include <array>
#include <stdexcept>
#include <string>
#include <thread>
#include "dim.h"
#include "keyring/keyring_manager.h"
#include "metadata_cache.h"
#include "my_thread.h"
#include "mysql/harness/config_parser.h"
#include "mysql/harness/loader_config.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/utility/string.h"
#include "mysqlrouter/mysql_client_thread_token.h"
#include "mysqlrouter/mysql_session.h"
#include "mysqlrouter/supported_metadata_cache_options.h"
#include "mysqlrouter/uri.h"
#include "mysqlrouter/utils.h"
#include "plugin_config.h"

Classes

class  MetadataServersStateListener
 

Macros

#define GET_OPTION_CHECKED(option, section, name, def_value)
 

Functions

static metadata_cache::RouterAttributes get_router_attributes (const mysql_harness::Config *cfg)
 
static void init (mysql_harness::PluginFuncEnv *env)
 
static std::string get_option (const mysql_harness::ConfigSection *section, const std::string &key, const std::string &def_value)
 
static mysqlrouter::SSLOptions make_ssl_options (const mysql_harness::ConfigSection *section)
 
static void start (mysql_harness::PluginFuncEnv *env)
 Initialize the metadata cache for fetching the information from the metadata servers. More...
 

Variables

static const mysql_harness::AppInfo * g_app_info
 
static const std::string kSectionName = "metadata_cache"
 
static const char * kKeyringAttributePassword = "password"
 
metadata_cache::RouterAttributes g_router_attributes
 
static const std::array< const char *, 2 > required
 
mysql_harness::Plugin METADATA_CACHE_PLUGIN_EXPORT harness_plugin_metadata_cache
 

Macro Definition Documentation

◆ GET_OPTION_CHECKED

#define GET_OPTION_CHECKED (   option,
  section,
  name,
  def_value 
)
Value:
option = get_option(section, name, def_value);
static std::string get_option(const mysql_harness::ConfigSection *section, const std::string &key, const std::string &def_value)
Definition: metadata_cache_plugin.cc:107
constexpr bool str_in_collection(const T &t, const std::string_view &k)
Definition: string.h:157
case opt name
Definition: sslopt-case.h:33
static constexpr std::array< const char *, 19 > metadata_cache_supported_options
Definition: supported_metadata_cache_options.h:31

Function Documentation

◆ get_option()

static std::string get_option ( const mysql_harness::ConfigSection section,
const std::string &  key,
const std::string &  def_value 
)
static

◆ get_router_attributes()

static metadata_cache::RouterAttributes get_router_attributes ( const mysql_harness::Config cfg)
static

◆ init()

static void init ( mysql_harness::PluginFuncEnv env)
static

◆ make_ssl_options()

static mysqlrouter::SSLOptions make_ssl_options ( const mysql_harness::ConfigSection section)
static

◆ start()

static void start ( mysql_harness::PluginFuncEnv env)
static

Initialize the metadata cache for fetching the information from the metadata servers.

Parameters
envplugin's environment

Variable Documentation

◆ g_app_info

const mysql_harness::AppInfo* g_app_info
static

◆ g_router_attributes

metadata_cache::RouterAttributes g_router_attributes

◆ harness_plugin_metadata_cache

mysql_harness::Plugin METADATA_CACHE_PLUGIN_EXPORT harness_plugin_metadata_cache
Initial value:
= {
mysql_harness::PLUGIN_ABI_VERSION,
mysql_harness::ARCHITECTURE_DESCRIPTOR,
"Metadata Cache, managing information fetched from the Metadata Server",
VERSION_NUMBER(0, 0, 1),
required.size(),
required.data(),
0,
nullptr,
init,
nullptr,
nullptr,
true,
}
static void init(mysql_harness::PluginFuncEnv *env)
Definition: metadata_cache_plugin.cc:93
static const std::array< const char *, 2 > required
Definition: metadata_cache_plugin.cc:292
static void start(mysql_harness::PluginFuncEnv *env)
Initialize the metadata cache for fetching the information from the metadata servers.
Definition: metadata_cache_plugin.cc:185

◆ kKeyringAttributePassword

const char* kKeyringAttributePassword = "password"
static

◆ kSectionName

const std::string kSectionName = "metadata_cache"
static

◆ required

const std::array<const char *, 2> required
static
Initial value:
= {{
"logger",
"router_protobuf",
}}