24#ifndef DD_CACHE__SHARED_DICTIONARY_CACHE_INCLUDED
25#define DD_CACHE__SHARED_DICTIONARY_CACHE_INCLUDED
174 template <
typename T>
179 template <
typename T>
196 static void reset(
bool keep_dd_entities);
210 template <
typename K,
typename T>
212 return m_map<T>()->available(
key);
237 template <
typename K,
typename T>
262 template <typename K, typename T>
264 const T **
object) const;
279 template <typename T>
293 template <typename T>
295 m_map<T>()->release(e);
310 template <
typename T>
312 m_map<T>()->drop(element);
329 template <
typename K,
typename T>
331 m_map<T>()->drop_if_present(
key);
347 template <
typename T>
349 m_map<T>()->replace(element,
object);
358 template <
typename T>
361 fprintf(stderr,
"================================\n");
362 fprintf(stderr,
"Shared dictionary cache\n");
364 fprintf(stderr,
"================================\n");
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Implementation of a dictionary client.
Definition: cache_element.h:69
Definition: shared_dictionary_cache.h:63
Shared_multi_map< Resource_group > m_resource_group_map
Definition: shared_dictionary_cache.h:86
bool get(THD *thd, const K &key, Cache_element< T > **element)
Get an element from the cache, given the key.
Definition: shared_dictionary_cache.cc:92
Shared_multi_map< Spatial_reference_system > * m_map(Type_selector< Spatial_reference_system >)
Definition: shared_dictionary_cache.h:123
Shared_multi_map< Schema > m_schema_map
Definition: shared_dictionary_cache.h:88
Shared_multi_map< Routine > m_routine_map
Definition: shared_dictionary_cache.h:87
Shared_multi_map< Charset > m_charset_map
Definition: shared_dictionary_cache.h:82
static void shutdown()
Definition: shared_dictionary_cache.cc:64
static Shared_dictionary_cache * instance()
Definition: shared_dictionary_cache.cc:40
Shared_multi_map< Routine > * m_map(Type_selector< Routine >)
Definition: shared_dictionary_cache.h:117
const Shared_multi_map< Column_statistics > * m_map(Type_selector< Column_statistics >) const
Definition: shared_dictionary_cache.h:141
const Shared_multi_map< Charset > * m_map(Type_selector< Charset >) const
Definition: shared_dictionary_cache.h:135
static const size_t resource_group_capacity
Maximum number of DD resource group objects to be kept in cache.
Definition: shared_dictionary_cache.h:79
void drop(Cache_element< T > *element)
Delete an element from the cache.
Definition: shared_dictionary_cache.h:311
const Shared_multi_map< Tablespace > * m_map(Type_selector< Tablespace >) const
Definition: shared_dictionary_cache.h:152
Shared_multi_map< Collation > * m_map(Type_selector< Collation >)
Definition: shared_dictionary_cache.h:107
Shared_dictionary_cache()=default
static const size_t event_capacity
Definition: shared_dictionary_cache.h:72
const Shared_multi_map< T > * m_map() const
Definition: shared_dictionary_cache.h:180
Shared_multi_map< Abstract_table > * m_map(Type_selector< Abstract_table >)
Overloaded functions to use for selecting map instance based on a key type.
Definition: shared_dictionary_cache.h:101
Shared_multi_map< Tablespace > * m_map(Type_selector< Tablespace >)
Definition: shared_dictionary_cache.h:127
Shared_multi_map< Schema > * m_map(Type_selector< Schema >)
Definition: shared_dictionary_cache.h:120
const Shared_multi_map< Collation > * m_map(Type_selector< Collation >) const
Definition: shared_dictionary_cache.h:138
Shared_multi_map< Column_statistics > * m_map(Type_selector< Column_statistics >)
Definition: shared_dictionary_cache.h:110
bool get_uncached(THD *thd, const K &key, enum_tx_isolation isolation, const T **object) const
Read an object directly from disk, given the key.
Definition: shared_dictionary_cache.cc:110
Shared_multi_map< Column_statistics > m_column_stat_map
Definition: shared_dictionary_cache.h:84
static const size_t charset_capacity
Definition: shared_dictionary_cache.h:71
Shared_multi_map< Spatial_reference_system > m_spatial_reference_system_map
Definition: shared_dictionary_cache.h:89
static bool reset_tables_and_tablespaces(THD *thd)
Definition: shared_dictionary_cache.cc:85
Shared_multi_map< T > * m_map()
Template function to get a map instance.
Definition: shared_dictionary_cache.h:175
Shared_multi_map< Abstract_table > m_abstract_table_map
Definition: shared_dictionary_cache.h:81
Shared_multi_map< Charset > * m_map(Type_selector< Charset >)
Definition: shared_dictionary_cache.h:104
const Shared_multi_map< Spatial_reference_system > * m_map(Type_selector< Spatial_reference_system >) const
Definition: shared_dictionary_cache.h:148
void drop_if_present(const K &key)
Delete an element corresponding to the key from the cache if exists.
Definition: shared_dictionary_cache.h:330
Shared_multi_map< Resource_group > * m_map(Type_selector< Resource_group >)
Definition: shared_dictionary_cache.h:114
static void init()
Definition: shared_dictionary_cache.cc:45
const Shared_multi_map< Abstract_table > * m_map(Type_selector< Abstract_table >) const
Definition: shared_dictionary_cache.h:131
static const size_t spatial_reference_system_capacity
Definition: shared_dictionary_cache.h:73
void release(Cache_element< T > *e)
Release an element used by a client.
Definition: shared_dictionary_cache.h:294
bool available(const K &key)
Check if an element with the given key is available.
Definition: shared_dictionary_cache.h:211
static const size_t column_statistics_capacity
Definition: shared_dictionary_cache.h:70
const Shared_multi_map< Resource_group > * m_map(Type_selector< Resource_group >) const
Definition: shared_dictionary_cache.h:155
void replace(Cache_element< T > *element, const T *object)
Replace the object and re-create the keys for an element.
Definition: shared_dictionary_cache.h:348
Shared_multi_map< Tablespace > m_tablespace_map
Definition: shared_dictionary_cache.h:90
Shared_multi_map< Collation > m_collation_map
Definition: shared_dictionary_cache.h:83
void dump() const
Debug dump of a shared cache partition to stderr.
Definition: shared_dictionary_cache.h:359
Shared_multi_map< Event > * m_map(Type_selector< Event >)
Definition: shared_dictionary_cache.h:113
void put(const T *object, Cache_element< T > **element)
Add an object to the shared cache.
Definition: shared_dictionary_cache.cc:122
const Shared_multi_map< Schema > * m_map(Type_selector< Schema >) const
Definition: shared_dictionary_cache.h:145
static const size_t collation_capacity
Definition: shared_dictionary_cache.h:69
static void reset(bool keep_dd_entities)
Definition: shared_dictionary_cache.cc:78
Shared_multi_map< Event > m_event_map
Definition: shared_dictionary_cache.h:85
Implementation of a shared set of maps for a given object type.
Definition: shared_multi_map.h:118
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:285
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:286
#define MY_COMPILER_CLANG_WORKAROUND_TPARAM_DOCBUG()
ignore -Wdocumentation compiler warnings for @tparam.
Definition: my_compiler.h:308
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
required string key
Definition: replication_asynchronous_connection_failover.proto:60
enum_tx_isolation
Definition: handler.h:3186
Definition: shared_dictionary_cache.h:93