MySQL 9.3.0
Source Code Documentation
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) const
 Tracks the Replication Replica feature, including the usage data. More...
 

Static Public Attributes

static unsigned long long m_opt_option_tracker_usage_binary_log = 0
 
static unsigned long long m_opt_option_tracker_usage_replication_replica = 0
 

Static Protected Member Functions

static bool cb_binlog (unsigned long long new_value)
 
static bool cb_replica (unsigned long long new_value)
 

Static Protected Attributes

static bool cb_binlog_define_failed = false
 
static bool cb_replica_define_failed = false
 

Private Types

using Service_type = const mysql_service_mysql_option_tracker_option_t
 
using Tracker_service_guard = my_service< Service_type >
 

Private Member Functions

void track_binary_log (const Tracker_service_guard &service_guard, bool enabled) const
 Tracks the Binary Log feature, including the usage data. More...
 
void track_replication_replica (const Tracker_service_guard &service_guard, bool enabled) const
 Tracks the Replication Replica feature, including the usage data. More...
 

Static Private Member Functions

static bool is_replication_replica_enabled ()
 Helper method to get Replication Replica feature status. More...
 
static void track (const Tracker_service_guard &service_guard, bool enabled, const std::string &fname, unsigned long long &usage_counter)
 Tracks a feature, including the usage data. More...
 

Private Attributes

mysql_service_registry_registration_tm_srv_registry_registration_no_lock {nullptr}
 
my_thread_handle m_thread_id
 
bool m_stop_worker {false}
 

Static Private Attributes

static constexpr auto m_service_name = "mysql_option_tracker_option"
 
static constexpr const Timeout_type s_tracking_period {600}
 
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
 

Detailed Description

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

Member Typedef Documentation

◆ Service_type

◆ Tracker_service_guard

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

◆ cb_binlog()

static bool Rpl_opt_tracker::cb_binlog ( unsigned long long  new_value)
inlinestaticprotected

◆ cb_replica()

static bool Rpl_opt_tracker::cb_replica ( unsigned long long  new_value)
inlinestaticprotected

◆ 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)

◆ 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()

void Rpl_opt_tracker::track ( const Tracker_service_guard service_guard,
bool  enabled,
const std::string &  fname,
unsigned long long &  usage_counter 
)
staticprivate

Tracks a 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
service_guardacquired service guard
enabledtrue: tracks as enabled false: tracks as disabled
fnamefeature name
usage_counterfeature usage counter

◆ track_binary_log()

void Rpl_opt_tracker::track_binary_log ( const Tracker_service_guard service_guard,
bool  enabled 
) const
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
service_guardacquired service guard
enabledtrue: tracks as enabled false: tracks as disabled

◆ track_replication_replica() [1/2]

void Rpl_opt_tracker::track_replication_replica ( bool  enabled) const

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() [2/2]

void Rpl_opt_tracker::track_replication_replica ( const Tracker_service_guard service_guard,
bool  enabled 
) const
private

Tracks the Replication Replica feature, including the usage data.

It only updates usage data if the feature is enabled.

Parameters
service_guardacquired service guard
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

◆ cb_binlog_define_failed

bool Rpl_opt_tracker::cb_binlog_define_failed = false
staticprotected

◆ cb_replica_define_failed

bool Rpl_opt_tracker::cb_replica_define_failed = false
staticprotected

◆ m_opt_option_tracker_usage_binary_log

unsigned long long Rpl_opt_tracker::m_opt_option_tracker_usage_binary_log = 0
static

◆ m_opt_option_tracker_usage_replication_replica

unsigned long long Rpl_opt_tracker::m_opt_option_tracker_usage_replication_replica = 0
static

◆ m_service_name

constexpr auto Rpl_opt_tracker::m_service_name = "mysql_option_tracker_option"
staticconstexprprivate

◆ 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_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 {600}
staticconstexprprivate

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