23#ifndef DD_CACHE__STORAGE_ADAPTER_INCLUDED
24#define DD_CACHE__STORAGE_ADAPTER_INCLUDED
39class CacheStorageTest;
95 template <
typename K,
typename T>
124 template <
typename T>
135 template <
typename T>
142 template <
typename T>
175 template <
typename K,
typename T>
177 bool bypass_core_registry,
const T **
object);
187 template <
typename T>
201 template <
typename T>
202 static bool drop(
THD *thd,
const T *
object);
216 template <
typename T>
230 template <
typename T>
231 static bool store(
THD *thd, T *
object);
242 template <
typename T>
243 bool core_sync(
THD *thd,
const typename T::Name_key &
key,
const T *
object);
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Definition: tablespace.h:54
Object registry containing several maps.
Definition: object_registry.h:61
void erase_all()
Remove and delete all objects from the registry.
Definition: object_registry.h:320
Handling of access to persistent storage.
Definition: storage_adapter.h:59
void core_update(const T *)
Update the dd object in the core registry.
Definition: storage_adapter.h:143
static bool get(THD *thd, const K &key, enum_tx_isolation isolation, bool bypass_core_registry, const T **object)
Get a dictionary object from persistent storage.
Definition: storage_adapter.cc:150
static Storage_adapter * instance()
Definition: storage_adapter.cc:80
Object_id next_oid()
Generate a new object id for a registry partition.
Definition: storage_adapter.cc:89
static const Object_id FIRST_OID
Use an id not starting at 1 to make it easy to recognize ids generated before objects are stored pers...
Definition: storage_adapter.h:68
void erase_all()
Remove and delete all elements and objects from core storage.
Definition: storage_adapter.cc:415
static bool store(THD *thd, T *object)
Store a dictionary object to persistent storage.
Definition: storage_adapter.cc:313
void core_get(const K &key, const T **object)
Get a dictionary object from core storage.
Definition: storage_adapter.cc:116
void core_store(THD *thd, T *object)
Store a dictionary object to core storage.
Definition: storage_adapter.cc:274
static bool drop(THD *thd, const T *object)
Drop a dictionary object from persistent storage.
Definition: storage_adapter.cc:242
Object_id core_get_id(const typename T::Name_key &key)
Get a dictionary object id from core storage.
Definition: storage_adapter.cc:103
~Storage_adapter()
Definition: storage_adapter.h:107
bool core_sync(THD *thd, const typename T::Name_key &key, const T *object)
Sync a dictionary object from persistent to core storage.
Definition: storage_adapter.cc:353
Object_registry m_core_registry
Definition: storage_adapter.h:98
mysql_mutex_t m_lock
Definition: storage_adapter.h:99
size_t core_size()
Get the number of core objects in a registry partition.
Definition: storage_adapter.cc:96
static bool s_use_fake_storage
Definition: storage_adapter.h:100
void core_drop(THD *thd, const T *object)
Drop a dictionary object from core storage.
Definition: storage_adapter.cc:214
void dump()
Dump the contents of the core storage.
Definition: storage_adapter.cc:421
Storage_adapter()
Definition: storage_adapter.h:103
friend class dd_cache_unittest::CacheStorageTest
Definition: storage_adapter.h:60
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:49
#define mysql_mutex_destroy(M)
Definition: mysql_mutex.h:45
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:56
#define mysql_mutex_init(K, M, A)
Definition: mysql_mutex.h:40
ABI for instrumented mutexes.
Definition: dictionary_client.h:1273
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
unsigned long long Object_id
Definition: object_id.h:30
Instrumentation helpers for mutexes.
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
enum_tx_isolation
Definition: handler.h:2984
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
MySQL mutex implementation.
#define MY_MUTEX_INIT_FAST
Definition: thr_mutex.h:67
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:39