MySQL 8.0.40
Source Code Documentation
PFS_data_lock_container Class Reference

#include <pfs_data_lock.h>

Inheritance diagram for PFS_data_lock_container:
[legend]

Public Member Functions

 PFS_data_lock_container ()
 
 ~PFS_data_lock_container () override
 
const char * cache_string (const char *string) override
 Add a string to the container cache. More...
 
const char * cache_data (const char *ptr, size_t length) override
 Add binary data to the container cache. More...
 
void cache_identifier (PSI_identifier kind, const char *str, size_t length, const char **cached_ptr, size_t *cached_length) override
 Add an identifier in the container cache. More...
 
bool accept_engine (const char *engine, size_t engine_length) override
 Check if the container accepts data for a particular engine. More...
 
bool accept_lock_id (const char *engine_lock_id, size_t engine_lock_id_length) override
 Check if the container accepts data for a particular lock. More...
 
bool accept_transaction_id (ulonglong transaction_id) override
 Check if the container accepts data for a particular transaction. More...
 
bool accept_thread_id_event_id (ulonglong thread_id, ulonglong event_id) override
 Check if the container accepts data for a particular event. More...
 
bool accept_object (const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length) override
 Check if the container accepts data for a particular object. More...
 
void add_lock_row (const char *engine, size_t engine_length, const char *engine_lock_id, size_t engine_lock_id_length, ulonglong transaction_id, ulonglong thread_id, ulonglong event_id, const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length, const char *index_name, size_t index_name_length, const void *identity, const char *lock_mode, const char *lock_type, const char *lock_status, const char *lock_data) override
 Add a row to table performance_schema.data_locks. More...
 
void clear ()
 Clear the container. More...
 
void shrink ()
 Shrink the container. More...
 
row_data_lockget_row (size_t index)
 
void set_filter (PFS_index_data_locks *filter)
 
- Public Member Functions inherited from PSI_server_data_lock_container
 PSI_server_data_lock_container ()=default
 
virtual ~PSI_server_data_lock_container ()=default
 

Private Attributes

size_t m_logical_row_index
 
std::vector< row_data_lock, PFS_data_container_allocator< row_data_lock > > m_rows
 
PFS_data_cache m_cache
 
PFS_index_data_locksm_filter
 

Constructor & Destructor Documentation

◆ PFS_data_lock_container()

PFS_data_lock_container::PFS_data_lock_container ( )

◆ ~PFS_data_lock_container()

PFS_data_lock_container::~PFS_data_lock_container ( )
overridedefault

Member Function Documentation

◆ accept_engine()

bool PFS_data_lock_container::accept_engine ( const char *  engine,
size_t  engine_length 
)
overridevirtual

Check if the container accepts data for a particular engine.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE ENGINE = ...
const std::string SELECT("SELECT")
Name of the static privileges.
@ WHERE
Definition: sql_yacc.h:679

Implements PSI_server_data_lock_container.

◆ accept_lock_id()

bool PFS_data_lock_container::accept_lock_id ( const char *  engine_lock_id,
size_t  engine_lock_id_length 
)
overridevirtual

Check if the container accepts data for a particular lock.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE ENGINE_LOCK_ID = ...

Implements PSI_server_data_lock_container.

◆ accept_object()

bool PFS_data_lock_container::accept_object ( const char *  table_schema,
size_t  table_schema_length,
const char *  table_name,
size_t  table_name_length,
const char *  partition_name,
size_t  partition_name_length,
const char *  sub_partition_name,
size_t  sub_partition_name_length 
)
overridevirtual

Check if the container accepts data for a particular object.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks
WHERE OBJECT_SCHEMA = ...
AND OBJECT_NAME = ...
AND PARTITION_NAME = ...
AND SUBPARTITION_NAME = ...

Implements PSI_server_data_lock_container.

◆ accept_thread_id_event_id()

bool PFS_data_lock_container::accept_thread_id_event_id ( ulonglong  thread_id,
ulonglong  event_id 
)
overridevirtual

Check if the container accepts data for a particular event.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks
WHERE THREAD_ID = ... AND EVENT_ID = ...

Implements PSI_server_data_lock_container.

◆ accept_transaction_id()

bool PFS_data_lock_container::accept_transaction_id ( ulonglong  transaction_id)
overridevirtual

Check if the container accepts data for a particular transaction.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE
ENGINE_TRANSACTION_ID = ...

Implements PSI_server_data_lock_container.

◆ add_lock_row()

void PFS_data_lock_container::add_lock_row ( const char *  engine,
size_t  engine_length,
const char *  engine_lock_id,
size_t  engine_lock_id_length,
ulonglong  transaction_id,
ulonglong  thread_id,
ulonglong  event_id,
const char *  table_schema,
size_t  table_schema_length,
const char *  table_name,
size_t  table_name_length,
const char *  partition_name,
size_t  partition_name_length,
const char *  sub_partition_name,
size_t  sub_partition_name_length,
const char *  index_name,
size_t  index_name_length,
const void *  identity,
const char *  lock_mode,
const char *  lock_type,
const char *  lock_status,
const char *  lock_data 
)
overridevirtual

Add a row to table performance_schema.data_locks.

Implements PSI_server_data_lock_container.

◆ cache_data()

const char * PFS_data_lock_container::cache_data ( const char *  ptr,
size_t  length 
)
overridevirtual

Add binary data to the container cache.

See also
cache_string

Implements PSI_server_data_lock_container.

◆ cache_identifier()

void PFS_data_lock_container::cache_identifier ( PSI_identifier  kind,
const char *  str,
size_t  length,
const char **  cached_ptr,
size_t *  cached_length 
)
overridevirtual

Add an identifier in the container cache.

Depending on the identifier kind, the string given may be normalized, to comply with lower_case_table_names, before adding the string into the cache. Beware that the normalized string length may differ from the input string length.

Parameters
[in]kindIdentifier kind, used for string normalization
[in]strIdentifier input string
[in]lengthIdentifier input string length
[out]cached_ptrCached, possibly normalized, identifier string
[out]cached_lengthCached identifier string length

Implements PSI_server_data_lock_container.

◆ cache_string()

const char * PFS_data_lock_container::cache_string ( const char *  string)
overridevirtual

Add a string to the container cache.

Cached strings have the same life cycle as the data container, and are freed when the container is destroyed. Also, duplicated strings value are cached with the same copy, avoiding memory duplication. This is useful in particular to cache table schema or table names, which are duplicated a lot for different row locks on the same table.

Implements PSI_server_data_lock_container.

◆ clear()

void PFS_data_lock_container::clear ( )

Clear the container.

New rows added will start at index 0.

◆ get_row()

row_data_lock * PFS_data_lock_container::get_row ( size_t  index)

◆ set_filter()

void PFS_data_lock_container::set_filter ( PFS_index_data_locks filter)
inline

◆ shrink()

void PFS_data_lock_container::shrink ( )

Shrink the container.

New rows added will continue to use the current index.

Member Data Documentation

◆ m_cache

PFS_data_cache PFS_data_lock_container::m_cache
private

◆ m_filter

PFS_index_data_locks* PFS_data_lock_container::m_filter
private

◆ m_logical_row_index

size_t PFS_data_lock_container::m_logical_row_index
private

◆ m_rows

std::vector<row_data_lock, PFS_data_container_allocator<row_data_lock> > PFS_data_lock_container::m_rows
private

The documentation for this class was generated from the following files: