27#ifndef TEMPTABLE_KV_STORE_H
28#define TEMPTABLE_KV_STORE_H
30#include <shared_mutex>
32#include <unordered_map>
58template <
typename Lock,
79 std::shared_lock<Lock>, std::lock_guard<Lock>>;
100 template <
class... Args>
101 std::pair<typename Key_value_store_impl::iterator, bool>
emplace(
118 return &iter->second;
131 std::vector<std::string> tables;
133 if (
table.owner_id() ==
id) {
134 tables.push_back(
name);
145 typename Key_value_store_impl::size_type
erase(
const std::string &
key) {
Default Key_value_store logging facility which turns to no-op in non-debug builds.
Definition: kv_store_logger.h:42
void dbug_print()
Definition: kv_store_logger.h:47
void log(Key_value_store_stats::Event)
Definition: kv_store_logger.h:44
Key-value store, a convenience wrapper class which models a thread-safe dictionary type.
Definition: kv_store.h:62
std::pair< typename Key_value_store_impl::iterator, bool > emplace(Args &&...args)
Inserts a new table into the container constructed in-place with the given args if there is no table ...
Definition: kv_store.h:101
std::conditional_t< std::is_same< Lock, std::shared_timed_mutex >::value, std::shared_lock< Lock >, std::lock_guard< Lock > > Exclusive_or_shared_lock
Check whether we can use shared locks (which enable multiple concurrent readers) or must we rather fa...
Definition: kv_store.h:79
Key_value_store_impl m_kv_store
Container holding (table-name, Table) tuples.
Definition: kv_store.h:85
KeyValueImpl< std::string, Table > Key_value_store_impl
Alias for our key-value store implementation.
Definition: kv_store.h:82
std::vector< std::string > find_all(my_thread_id id)
Searches for all tables tagged with the given owner ID.
Definition: kv_store.h:129
Key_value_store_impl::size_type erase(const std::string &key)
Removes the table (if one exists) with the given name (key).
Definition: kv_store.h:145
Table * find(const std::string &key)
Searches for a table with given name (key).
Definition: kv_store.h:114
Lock m_lock
Lock type.
Definition: kv_store.h:88
TempTable key-value store logger implementation.
uint32 my_thread_id
Definition: my_thread_local.h:34
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: allocator.h:48
constexpr bool DEBUG_BUILD
Store build-type information into the constexpr expression.
Definition: constants.h:76
std::unordered_map< Key, Value, Hash, Key_equal, ut::allocator< std::pair< const Key, Value > > > unordered_map
Definition: ut0new.h:2900
static std::mutex lock
Definition: net_ns.cc:56
required string key
Definition: replication_asynchronous_connection_failover.proto:60
case opt name
Definition: sslopt-case.h:29