MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Rpl_opt_tracker Class Reference

Class to track the state and usage data of Replication features. More...

#include <rpl_opt_tracker.h>

Public Member Functions

 Rpl_opt_tracker (mysql_service_registry_registration_t *srv_registry_registration, mysql_service_registry_registration_t *srv_registry_registration_no_lock)
 
virtual ~Rpl_opt_tracker ()
 
Rpl_opt_trackeroperator= (const Rpl_opt_tracker &info)
 
 Rpl_opt_tracker (const Rpl_opt_tracker &info)
 
void worker ()
 The thread worker that periodically tracks the replication features. More...
 
void start_worker ()
 Start the thread that periodically tracks the replication features. More...
 
void stop_worker ()
 Stop the thread that periodically tracks the replication features. More...
 
void track_replication_replica (bool enabled)
 Tracks the Replication Replica feature, including the usage data. More...
 

Private Member Functions

void track_binary_log_internal (bool enabled)
 Tracks the Binary Log feature, including the usage data. More...
 
void track_replication_replica_internal (bool enabled)
 Tracks the Replication Replica feature, including the usage data. More...
 
void track_group_replication_usage_internal (bool enabled)
 Tracks the Group Replication feature usage data. More...
 
bool acquire_option_tracker_service ()
 Helper method to acquire the mysql_option_tracker_option service. More...
 
void release_option_tracker_service ()
 Helper method to release the mysql_option_tracker_option service. More...
 

Static Private Member Functions

static bool is_replication_replica_enabled ()
 Helper method to get Replication Replica feature status. More...
 

Private Attributes

mysql_service_registry_registration_tm_srv_registry_registration_no_lock {nullptr}
 
const mysql_service_mysql_option_tracker_option_tm_option_tracker_service {nullptr}
 
my_h_service m_option_tracker_handle {nullptr}
 
my_thread_handle m_thread_id
 
bool m_stop_worker {false}
 
Option_usage_data m_option_usage_binary_log
 
Option_usage_data m_option_usage_replication_replica
 
Option_usage_data m_option_usage_group_replication
 

Static Private Attributes

static constexpr const Timeout_type s_tracking_period {3600}
 
static const std::string s_c_name_mysql_server {"mysql_server"}
 
static const std::string s_f_name_binary_log {"Binary Log"}
 
static const std::string s_f_name_replication_replica
 
static const std::string s_f_name_group_replication
 

Detailed Description

Class to track the state and usage data of Replication features.

Constructor & Destructor Documentation

◆ Rpl_opt_tracker() [1/2]

Rpl_opt_tracker::Rpl_opt_tracker ( mysql_service_registry_registration_t srv_registry_registration,
mysql_service_registry_registration_t srv_registry_registration_no_lock 
)

◆ ~Rpl_opt_tracker()

Rpl_opt_tracker::~Rpl_opt_tracker ( )
virtual

◆ Rpl_opt_tracker() [2/2]

Rpl_opt_tracker::Rpl_opt_tracker ( const Rpl_opt_tracker info)

Member Function Documentation

◆ acquire_option_tracker_service()

bool Rpl_opt_tracker::acquire_option_tracker_service ( )
private

Helper method to acquire the mysql_option_tracker_option service.

Returns
the operation status
Return values
falseSuccessful
trueError

◆ is_replication_replica_enabled()

bool Rpl_opt_tracker::is_replication_replica_enabled ( )
staticprivate

Helper method to get Replication Replica feature status.

Returns
Replication Replica feature status
Return values
trueenabled
falsedisabled

◆ operator=()

Rpl_opt_tracker & Rpl_opt_tracker::operator= ( const Rpl_opt_tracker info)

◆ release_option_tracker_service()

void Rpl_opt_tracker::release_option_tracker_service ( )
private

Helper method to release the mysql_option_tracker_option service.

◆ start_worker()

void Rpl_opt_tracker::start_worker ( )

Start the thread that periodically tracks the replication features.

◆ stop_worker()

void Rpl_opt_tracker::stop_worker ( )

Stop the thread that periodically tracks the replication features.

◆ track_binary_log_internal()

void Rpl_opt_tracker::track_binary_log_internal ( bool  enabled)
private

Tracks the Binary Log feature, including the usage data.

It only updates usage data if the feature is enabled. Internal method to be used after the mysql_option_tracker_option service is acquired.

Parameters
enabledtrue: tracks as enabled false: tracks as disabled

◆ track_group_replication_usage_internal()

void Rpl_opt_tracker::track_group_replication_usage_internal ( bool  enabled)
private

Tracks the Group Replication feature usage data.

It only updates usage data if the feature is enabled.

Parameters
enabledtrue: tracks as enabled false: tracks as disabled

◆ track_replication_replica()

void Rpl_opt_tracker::track_replication_replica ( bool  enabled)

Tracks the Replication Replica feature, including the usage data.

It only updates usage data if the feature is enabled.

Parameters
enabledtrue: tracks as enabled false: tracks as disabled

◆ track_replication_replica_internal()

void Rpl_opt_tracker::track_replication_replica_internal ( bool  enabled)
private

Tracks the Replication Replica feature, including the usage data.

It only updates usage data if the feature is enabled. Internal method to be used after the mysql_option_tracker_option service is acquired.

Parameters
enabledtrue: tracks as enabled false: tracks as disabled

◆ worker()

void Rpl_opt_tracker::worker ( )

The thread worker that periodically tracks the replication features.

Member Data Documentation

◆ m_option_tracker_handle

my_h_service Rpl_opt_tracker::m_option_tracker_handle {nullptr}
private

◆ m_option_tracker_service

const mysql_service_mysql_option_tracker_option_t* Rpl_opt_tracker::m_option_tracker_service {nullptr}
private

◆ m_option_usage_binary_log

Option_usage_data Rpl_opt_tracker::m_option_usage_binary_log
private

◆ m_option_usage_group_replication

Option_usage_data Rpl_opt_tracker::m_option_usage_group_replication
private

◆ m_option_usage_replication_replica

Option_usage_data Rpl_opt_tracker::m_option_usage_replication_replica
private

◆ m_srv_registry_registration_no_lock

mysql_service_registry_registration_t* Rpl_opt_tracker::m_srv_registry_registration_no_lock {nullptr}
private

◆ m_stop_worker

bool Rpl_opt_tracker::m_stop_worker {false}
private

◆ m_thread_id

my_thread_handle Rpl_opt_tracker::m_thread_id
private

◆ s_c_name_mysql_server

const std::string Rpl_opt_tracker::s_c_name_mysql_server {"mysql_server"}
staticprivate

◆ s_f_name_binary_log

const std::string Rpl_opt_tracker::s_f_name_binary_log {"Binary Log"}
staticprivate

◆ s_f_name_group_replication

const std::string Rpl_opt_tracker::s_f_name_group_replication
staticprivate
Initial value:
{
"Group Replication"}

◆ s_f_name_replication_replica

const std::string Rpl_opt_tracker::s_f_name_replication_replica
staticprivate
Initial value:
{
"Replication Replica"}

◆ s_tracking_period

constexpr const Timeout_type Rpl_opt_tracker::s_tracking_period {3600}
staticconstexprprivate

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