MySQL 8.0.29
Source Code Documentation
binary_log::Heartbeat_event_v2 Class Reference

Replication event to ensure to replica that source is alive. More...

#include <control_events.h>

Inheritance diagram for binary_log::Heartbeat_event_v2:
[legend]

Public Member Functions

 Heartbeat_event_v2 (const char *buf, const Format_description_event *fde)
 Sent by a source to a replica to let the replica know that the source is still alive. More...
 
 Heartbeat_event_v2 ()
 Creates an empty heartbeat event. More...
 
virtual ~Heartbeat_event_v2 () override=default
 
void set_log_filename (const std::string name)
 
void set_log_position (uint64_t position)
 
const std::string get_log_filename () const
 
uint64_t get_log_position () const
 
- Public Member Functions inherited from binary_log::Binary_log_event
virtual ~Binary_log_event ()=0
 
 Binary_log_event (const Binary_log_event &)=default
 
 Binary_log_event (Binary_log_event &&)=default
 
Binary_log_eventoperator= (const Binary_log_event &)=default
 
Binary_log_eventoperator= (Binary_log_event &&)=default
 
enum Log_event_type get_event_type () const
 Helper method. More...
 
const Log_event_headerheader () const
 Return a const pointer to the header of the log event. More...
 
Log_event_headerheader ()
 Return a non-const pointer to the header of the log event. More...
 
const Log_event_footerfooter () const
 Return a const pointer to the footer of the log event. More...
 
Log_event_footerfooter ()
 Return a non-const pointer to the footer of the log event. More...
 
Event_readerreader ()
 Returns a reference to the event Event_reader object. More...
 

Static Public Member Functions

static uint64_t max_encoding_length ()
 This member function returns the len of the event. More...
 

Protected Attributes

std::string m_log_filename {}
 
uint64_t m_log_position {0}
 

Additional Inherited Members

- Public Types inherited from binary_log::Binary_log_event
enum  enum_post_header_length {
  QUERY_HEADER_MINIMAL_LEN = (4 + 4 + 1 + 2) , QUERY_HEADER_LEN = (QUERY_HEADER_MINIMAL_LEN + 2) , STOP_HEADER_LEN = 0 , START_V3_HEADER_LEN = (2 + ST_SERVER_VER_LEN + 4) ,
  ROTATE_HEADER_LEN = 8 , INTVAR_HEADER_LEN = 0 , APPEND_BLOCK_HEADER_LEN = 4 , DELETE_FILE_HEADER_LEN = 4 ,
  RAND_HEADER_LEN = 0 , USER_VAR_HEADER_LEN = 0 , FORMAT_DESCRIPTION_HEADER_LEN = (START_V3_HEADER_LEN + 1 + LOG_EVENT_TYPES) , XID_HEADER_LEN = 0 ,
  BEGIN_LOAD_QUERY_HEADER_LEN = APPEND_BLOCK_HEADER_LEN , ROWS_HEADER_LEN_V1 = 8 , TABLE_MAP_HEADER_LEN = 8 , EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN = (4 + 4 + 4 + 1) ,
  EXECUTE_LOAD_QUERY_HEADER_LEN , INCIDENT_HEADER_LEN = 2 , HEARTBEAT_HEADER_LEN = 0 , IGNORABLE_HEADER_LEN = 0 ,
  ROWS_HEADER_LEN_V2 = 10 , TRANSACTION_CONTEXT_HEADER_LEN = 18 , VIEW_CHANGE_HEADER_LEN = 52 , XA_PREPARE_HEADER_LEN = 0 ,
  TRANSACTION_PAYLOAD_HEADER_LEN = 0
}
 The lengths for the fixed data part of each event. More...
 
- Static Public Attributes inherited from binary_log::Binary_log_event
static const int LOG_EVENT_TYPES = (ENUM_END_EVENT - 1)
 
- Protected Member Functions inherited from binary_log::Binary_log_event
 Binary_log_event (Log_event_type type_code)
 This constructor is used to initialize the type_code of header object m_header. More...
 
 Binary_log_event (const char **buf, const Format_description_event *fde)
 This constructor will create a new object of Log_event_header and initialize the variable m_header, which in turn will be used to initialize Log_event's member common_header. More...
 

Detailed Description

Replication event to ensure to replica that source is alive.

The event is originated by source's dump thread and sent straight to replica without being logged. Slave itself does not store it in relay log but rather uses a data for immediate checks and throws away the event.

Two members of the class m_log_filename and m_log_position comprise

See also
the rpl_event_coordinates instance. The coordinates that a heartbeat instance carries correspond to the last event source has sent from its binlog.

Also this event will be generated only for the source server with version > 8.0.26

Binary Format

The Body has one component:

Body for Heartbeat_event
Name Format

Description

m_log_filename String variable to store the binlog name Name of the current binlog being written to.
m_log_pos 8 byte unsigned integar Name of the current binlog being written to.

Constructor & Destructor Documentation

◆ Heartbeat_event_v2() [1/2]

binary_log::Heartbeat_event_v2::Heartbeat_event_v2 ( const char *  buf,
const Format_description_event fde 
)

Sent by a source to a replica to let the replica know that the source is still alive.

Events of this type do not appear in the binary or relay logs. They are generated on a source server by the thread that dumps events and sent straight to the replica without ever being written to the binary log.

Parameters
bufContains the serialized event.
fdeAn FDE event (see Rotate_event constructor for more info).

◆ Heartbeat_event_v2() [2/2]

binary_log::Heartbeat_event_v2::Heartbeat_event_v2 ( )

Creates an empty heartbeat event.

◆ ~Heartbeat_event_v2()

virtual binary_log::Heartbeat_event_v2::~Heartbeat_event_v2 ( )
overridevirtualdefault

Member Function Documentation

◆ get_log_filename()

const std::string binary_log::Heartbeat_event_v2::get_log_filename ( ) const

◆ get_log_position()

uint64_t binary_log::Heartbeat_event_v2::get_log_position ( ) const

◆ max_encoding_length()

uint64_t binary_log::Heartbeat_event_v2::max_encoding_length ( )
static

This member function returns the len of the event.

Returns
the event len

◆ set_log_filename()

void binary_log::Heartbeat_event_v2::set_log_filename ( const std::string  name)

◆ set_log_position()

void binary_log::Heartbeat_event_v2::set_log_position ( uint64_t  position)

Member Data Documentation

◆ m_log_filename

std::string binary_log::Heartbeat_event_v2::m_log_filename {}
protected

◆ m_log_position

uint64_t binary_log::Heartbeat_event_v2::m_log_position {0}
protected

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