MySQL 8.0.39
Source Code Documentation
GRNotificationListener::Impl Struct Reference

Public Member Functions

 Impl (const mysqlrouter::UserCredentials &auth_user_credentials)
 
 ~Impl ()
 
xcl::XError connect (NodeSession &session, NodeId &node_id)
 
void listener_thread_func ()
 
bool read_from_session (const NodeId &node_id, NodeSession &session)
 
xcl::XError enable_notices (xcl::XSession &session, const NodeId &node_id, const std::string &cluster_name) noexcept
 Replication events are delivered to the client only when client explicitly request them. More...
 
void set_mysqlx_wait_timeout (xcl::XSession &session, const NodeId &node_id) noexcept
 
void check_mysqlx_wait_timeout ()
 
xcl::XError ping (xcl::XSession &session) noexcept
 
void remove_node_session (const NodeId &node) noexcept
 
void reconfigure (const metadata_cache::ClusterTopology &cluster_topology, const NotificationClb &notification_clb)
 
xcl::Handler_result notice_handler (const xcl::XProtocol *, const bool, const Mysqlx::Notice::Frame::Type type, const char *, const uint32_t)
 

Public Attributes

mysqlrouter::UserCredentials user_credentials
 
std::map< NodeId, NodeSession > sessions_
 
bool sessions_changed_ {false}
 
std::mutex configuration_data_mtx_
 
std::atomic< bool > mysqlx_wait_timeout_set_ {false}
 
std::unique_ptr< std::thread > listener_thread
 
std::atomic< bool > terminate {false}
 
NotificationClb notification_callback
 
std::chrono::steady_clock::time_point last_ping_timepoint
 

Constructor & Destructor Documentation

◆ Impl()

GRNotificationListener::Impl::Impl ( const mysqlrouter::UserCredentials auth_user_credentials)
inline

◆ ~Impl()

GRNotificationListener::Impl::~Impl ( )

Member Function Documentation

◆ check_mysqlx_wait_timeout()

void GRNotificationListener::Impl::check_mysqlx_wait_timeout ( )

◆ connect()

xcl::XError GRNotificationListener::Impl::connect ( NodeSession &  session,
NodeId &  node_id 
)

◆ enable_notices()

xcl::XError GRNotificationListener::Impl::enable_notices ( xcl::XSession &  session,
const NodeId &  node_id,
const std::string &  cluster_name 
)
noexcept

Replication events are delivered to the client only when client explicitly request them.

This function uses enable_notice to request notifications for all 4 event types:

  • quorum lost
  • view
  • role_changed
  • state_changed

◆ listener_thread_func()

void GRNotificationListener::Impl::listener_thread_func ( )

◆ notice_handler()

xcl::Handler_result GRNotificationListener::Impl::notice_handler ( const xcl::XProtocol *  ,
const bool  ,
const Mysqlx::Notice::Frame::Type  type,
const char *  payload,
const uint32_t  payload_size 
)

◆ ping()

xcl::XError GRNotificationListener::Impl::ping ( xcl::XSession &  session)
noexcept

◆ read_from_session()

bool GRNotificationListener::Impl::read_from_session ( const NodeId &  node_id,
NodeSession &  session 
)

◆ reconfigure()

void GRNotificationListener::Impl::reconfigure ( const metadata_cache::ClusterTopology cluster_topology,
const NotificationClb notification_clb 
)

◆ remove_node_session()

void GRNotificationListener::Impl::remove_node_session ( const NodeId &  node)
noexcept

◆ set_mysqlx_wait_timeout()

void GRNotificationListener::Impl::set_mysqlx_wait_timeout ( xcl::XSession &  session,
const NodeId &  node_id 
)
noexcept

Member Data Documentation

◆ configuration_data_mtx_

std::mutex GRNotificationListener::Impl::configuration_data_mtx_

◆ last_ping_timepoint

std::chrono::steady_clock::time_point GRNotificationListener::Impl::last_ping_timepoint
Initial value:
=
std::chrono::steady_clock::now()

◆ listener_thread

std::unique_ptr<std::thread> GRNotificationListener::Impl::listener_thread

◆ mysqlx_wait_timeout_set_

std::atomic<bool> GRNotificationListener::Impl::mysqlx_wait_timeout_set_ {false}

◆ notification_callback

NotificationClb GRNotificationListener::Impl::notification_callback

◆ sessions_

std::map<NodeId, NodeSession> GRNotificationListener::Impl::sessions_

◆ sessions_changed_

bool GRNotificationListener::Impl::sessions_changed_ {false}

◆ terminate

std::atomic<bool> GRNotificationListener::Impl::terminate {false}

◆ user_credentials

mysqlrouter::UserCredentials GRNotificationListener::Impl::user_credentials

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