MySQL 8.3.0
Source Code Documentation
Purge_groups_t Struct Reference

Public Types

using GroupBy = std::unordered_map< table_id_t, std::size_t, std::hash< table_id_t >, std::equal_to< table_id_t >, mem_heap_allocator< std::pair< const table_id_t, std::size_t > > >
 
using vec_alloc = mem_heap_allocator< purge_node_t::Recs * >
 Allocator used for the vector below. More...
 

Public Member Functions

 Purge_groups_t (std::size_t n_threads, mem_heap_t *heap)
 
void init ()
 
std::size_t find_smallest_group ()
 
void distribute_if_needed ()
 Check the history list length and decide if distribution of workload between purge threads is needed or not. More...
 
std::ostream & print (std::ostream &out) const
 
void assign (que_thr_t **thrs)
 
bool is_grouping_uniform () const
 
void add (purge_node_t::rec_t &rec)
 

Public Attributes

GroupBy m_grpid_umap
 Given a table_id obtain the group id to which it belongs. More...
 
std::vector< purge_node_t::Recs *, vec_allocm_groups
 A vector of groups. More...
 
mem_heap_tm_heap
 Memory heap in which memory for unordered_map & vector is allocated. More...
 
std::size_t m_total_rec
 Total number of undo records parsed and grouped. More...
 

Private Member Functions

void distribute ()
 Redistribute the undo records across different groups. More...
 

Member Typedef Documentation

◆ GroupBy

using Purge_groups_t::GroupBy = std::unordered_map< table_id_t, std::size_t, std::hash<table_id_t>, std::equal_to<table_id_t>, mem_heap_allocator<std::pair<const table_id_t, std::size_t> >>

◆ vec_alloc

Allocator used for the vector below.

Constructor & Destructor Documentation

◆ Purge_groups_t()

Purge_groups_t::Purge_groups_t ( std::size_t  n_threads,
mem_heap_t heap 
)
inline

Member Function Documentation

◆ add()

void Purge_groups_t::add ( purge_node_t::rec_t rec)
inline

◆ assign()

void Purge_groups_t::assign ( que_thr_t **  thrs)
inline

◆ distribute()

void Purge_groups_t::distribute ( )
private

Redistribute the undo records across different groups.

If a group has more records than it should, move all the extra records to the next group. Maximum two passes might be needed.

◆ distribute_if_needed()

void Purge_groups_t::distribute_if_needed ( )

Check the history list length and decide if distribution of workload between purge threads is needed or not.

If needed, do the distribution, otherwise do nothing.

◆ find_smallest_group()

std::size_t Purge_groups_t::find_smallest_group ( )

◆ init()

void Purge_groups_t::init ( void  )
inline

◆ is_grouping_uniform()

bool Purge_groups_t::is_grouping_uniform ( ) const

◆ print()

std::ostream & Purge_groups_t::print ( std::ostream &  out) const

Member Data Documentation

◆ m_groups

std::vector<purge_node_t::Recs *, vec_alloc> Purge_groups_t::m_groups

A vector of groups.

The size of this vector is equal to the number of purge threads. Each undo record is assigned to one of the groups, based on its table_id. The index into this vector is the group_id.

◆ m_grpid_umap

GroupBy Purge_groups_t::m_grpid_umap

Given a table_id obtain the group id to which it belongs.

◆ m_heap

mem_heap_t* Purge_groups_t::m_heap

Memory heap in which memory for unordered_map & vector is allocated.

◆ m_total_rec

std::size_t Purge_groups_t::m_total_rec

Total number of undo records parsed and grouped.


The documentation for this struct was generated from the following file: