MySQL 8.3.0
Source Code Documentation
Binlog_group_commit_ctx Class Reference

Keeps the THD session context to be used with the Bgc_ticket_manager. More...

#include <rpl_context.h>

Public Member Functions

 Binlog_group_commit_ctx ()=default
 
virtual ~Binlog_group_commit_ctx ()=default
 
binlog::BgcTicket get_session_ticket ()
 Retrieves the ticket that the THD session has been assigned to. More...
 
void set_session_ticket (binlog::BgcTicket ticket)
 Sets the THD session's ticket to the given value. More...
 
void assign_ticket ()
 Assigns the THD session to the ticket accepting assignments in the ticket manager. More...
 
bool has_waited ()
 Whether or not the session already waited on the ticket. More...
 
void mark_as_already_waited ()
 Marks the underlying session has already waited on the ticket. More...
 
void reset ()
 Resets the THD session's ticket context. More...
 
std::string to_string () const
 Returns the textual representation of this object;. More...
 
void format (std::ostream &out) const
 Dumps the textual representation of this object into the given output stream. More...
 

Static Public Member Functions

static memory::Aligned_atomic< bool > & manual_ticket_setting ()
 Retrieves the flag for determining if it should be possible to manually set the session's ticket. More...
 

Private Attributes

binlog::BgcTicket m_session_ticket {0}
 The ticket the THD session has been assigned to. More...
 
bool m_has_waited {false}
 Whether or not the session already waited on the ticket. More...
 

Friends

std::ostream & operator<< (std::ostream &out, Binlog_group_commit_ctx const &to_dump)
 Dumps the textual representation of an instance of this class into the given output stream. More...
 

Detailed Description

Keeps the THD session context to be used with the Bgc_ticket_manager.

In particular, manages the value of the ticket the current THD session has been assigned to.

Constructor & Destructor Documentation

◆ Binlog_group_commit_ctx()

Binlog_group_commit_ctx::Binlog_group_commit_ctx ( )
default

◆ ~Binlog_group_commit_ctx()

virtual Binlog_group_commit_ctx::~Binlog_group_commit_ctx ( )
virtualdefault

Member Function Documentation

◆ assign_ticket()

void Binlog_group_commit_ctx::assign_ticket ( )

Assigns the THD session to the ticket accepting assignments in the ticket manager.

The method is idem-potent within the execution of a statement. This means that it can be invoked several times during the execution of a command within the THD session that only once will the session be assign to a ticket.

◆ format()

void Binlog_group_commit_ctx::format ( std::ostream &  out) const

Dumps the textual representation of this object into the given output stream.

Parameters
outThe stream to dump this object into.

◆ get_session_ticket()

binlog::BgcTicket Binlog_group_commit_ctx::get_session_ticket ( )

Retrieves the ticket that the THD session has been assigned to.

If it hasn't been assigned to any yet, returns '0'.

Returns
The ticket the THD session has been assigned to, if any. Returns 0 if it hasn't.

◆ has_waited()

bool Binlog_group_commit_ctx::has_waited ( )

Whether or not the session already waited on the ticket.

Returns
true if the session already waited, false otherwise.

◆ manual_ticket_setting()

memory::Aligned_atomic< bool > & Binlog_group_commit_ctx::manual_ticket_setting ( )
static

Retrieves the flag for determining if it should be possible to manually set the session's ticket.

Returns
the reference for the atomic flag.

◆ mark_as_already_waited()

void Binlog_group_commit_ctx::mark_as_already_waited ( )

Marks the underlying session has already waited on the ticket.

◆ reset()

void Binlog_group_commit_ctx::reset ( void  )

Resets the THD session's ticket context.

◆ set_session_ticket()

void Binlog_group_commit_ctx::set_session_ticket ( binlog::BgcTicket  ticket)

Sets the THD session's ticket to the given value.

Parameters
ticketThe ticket to set the THD session to.

◆ to_string()

std::string Binlog_group_commit_ctx::to_string ( ) const

Returns the textual representation of this object;.

Returns
a string containing the textual representation of this object.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
Binlog_group_commit_ctx const &  to_dump 
)
friend

Dumps the textual representation of an instance of this class into the given output stream.

Parameters
outThe output stream to dump the instance to.
to_dumpThe class instance to dump to the output stream.
Returns
The output stream to which the instance was dumped to.

Member Data Documentation

◆ m_has_waited

bool Binlog_group_commit_ctx::m_has_waited {false}
private

Whether or not the session already waited on the ticket.

◆ m_session_ticket

binlog::BgcTicket Binlog_group_commit_ctx::m_session_ticket {0}
private

The ticket the THD session has been assigned to.


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