MySQL 9.1.0
Source Code Documentation
Pipeline_event Class Reference

A wrapper for log events/packets. More...

#include <pipeline_interfaces.h>

Public Types

enum class  Pipeline_event_type { PEVENT_DATA_PACKET_TYPE_E = 1 , PEVENT_BINARY_LOG_EVENT_TYPE_E = 2 , PEVENT_APPLIER_ONLY_EVENT_E = 3 }
 

Public Member Functions

 Pipeline_event (Data_packet *base_packet, Format_description_log_event *fde_event, int modifier=UNDEFINED_EVENT_MODIFIER, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, Members_list *online_members=nullptr)
 Create a new pipeline wrapper based on a packet. More...
 
 Pipeline_event (Log_event *base_event, Format_description_log_event *fde_event, int modifier=UNDEFINED_EVENT_MODIFIER, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, Members_list *online_members=nullptr)
 Create a new pipeline wrapper based on a log event. More...
 
 Pipeline_event (Packet *packet, int modifier=UNDEFINED_EVENT_MODIFIER, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, Members_list *online_members=nullptr)
 
 ~Pipeline_event ()
 
int get_FormatDescription (Format_description_log_event **out_fde)
 Return current format description event. More...
 
int get_LogEvent (Log_event **out_event)
 Return a log event. More...
 
Pipeline_event_type get_pipeline_event_type ()
 
void set_LogEvent (Log_event *in_event)
 Sets the pipeline event's log event. More...
 
void set_Packet (Data_packet *in_packet)
 Sets the pipeline event's packet. More...
 
int get_Packet (Data_packet **out_packet)
 Return a packet. More...
 
mysql::binlog::event::Log_event_type get_event_type ()
 Returns the event type. More...
 
void mark_event (int modifier)
 Sets the event context flag. More...
 
int get_event_context ()
 Returns the event context flag. More...
 
void reset_pipeline_event ()
 Resets all variables in the event for reuse. More...
 
enum_group_replication_consistency_level get_consistency_level ()
 Get transaction consistency level. More...
 
Members_listget_online_members ()
 Get the list of ONLINE Group members when a Transaction_with_guarantee_message message was received, or NULL if if any group member version is from a version lower than TRANSACTION_WITH_GUARANTEES_VERSION. More...
 
Packetget_applier_event_packet ()
 
void release_online_members_memory_ownership ()
 Release memory ownership of m_online_members. More...
 
void set_delayed_view_change_waiting_for_consistent_transactions ()
 Set view change cannot be processed now and should be delayed due to consistent transaction. More...
 
bool is_delayed_view_change_waiting_for_consistent_transactions ()
 Check if current view change is delayed due to consistent transaction. More...
 
void set_delayed_view_change_resumed ()
 Allow resume the log of delayed views that were waiting for consistent transactions from previous view to complete. More...
 
bool is_delayed_view_change_resumed ()
 Check if old view change processing is resumed. More...
 

Private Types

enum class  Processing_state { DEFAULT , DELAYED_VIEW_CHANGE_WAITING_FOR_CONSISTENT_TRANSACTIONS , DELAYED_VIEW_CHANGE_RESUMED }
 

Private Member Functions

int convert_packet_to_log_event ()
 Converts the existing packet into a log event. More...
 
int convert_log_event_to_packet ()
 Converts the existing log event into a packet. More...
 

Private Attributes

Data_packetpacket
 
Log_eventlog_event
 
Packetpacket_event {nullptr}
 
int event_context
 
Format_description_log_eventformat_descriptor
 
enum_group_replication_consistency_level m_consistency_level
 
Members_listm_online_members
 
bool m_online_members_memory_ownership
 
Processing_state m_packet_processing_state {Processing_state::DEFAULT}
 
Pipeline_event_type m_processing_event_type
 

Detailed Description

A wrapper for log events/packets.

This class allows for the marking of events and its transformation between the packet and log event formats as requested in the interface.

Note
Events can be marked as with event modifiers. This is a generic field allowing modifiers to vary with use context. If not specified, this field has a default value of 0.

Member Enumeration Documentation

◆ Pipeline_event_type

Enumerator
PEVENT_DATA_PACKET_TYPE_E 
PEVENT_BINARY_LOG_EVENT_TYPE_E 
PEVENT_APPLIER_ONLY_EVENT_E 

◆ Processing_state

enum class Pipeline_event::Processing_state
strongprivate
Enumerator
DEFAULT 
DELAYED_VIEW_CHANGE_WAITING_FOR_CONSISTENT_TRANSACTIONS 
DELAYED_VIEW_CHANGE_RESUMED 

Constructor & Destructor Documentation

◆ Pipeline_event() [1/3]

Pipeline_event::Pipeline_event ( Data_packet base_packet,
Format_description_log_event fde_event,
int  modifier = UNDEFINED_EVENT_MODIFIER,
enum_group_replication_consistency_level  consistency_level = GROUP_REPLICATION_CONSISTENCY_EVENTUAL,
Members_list online_members = nullptr 
)
inline

Create a new pipeline wrapper based on a packet.

Note
If a modifier is not provided the event will be marked as UNDEFINED
Parameters
[in]base_packetthe wrapper packet
[in]fde_eventthe format description event for conversions
[in]modifierthe event modifier
[in]consistency_levelthe transaction consistency level
[in]online_membersthe ONLINE members when the transaction message was delivered

◆ Pipeline_event() [2/3]

Pipeline_event::Pipeline_event ( Log_event base_event,
Format_description_log_event fde_event,
int  modifier = UNDEFINED_EVENT_MODIFIER,
enum_group_replication_consistency_level  consistency_level = GROUP_REPLICATION_CONSISTENCY_EVENTUAL,
Members_list online_members = nullptr 
)
inline

Create a new pipeline wrapper based on a log event.

Note
If a modifier is not provided the event will be marked as UNDEFINED
Parameters
[in]base_eventthe wrapper log event
[in]fde_eventthe format description event for conversions
[in]modifierthe event modifier
[in]consistency_levelthe transaction consistency level
[in]online_membersthe ONLINE members when the transaction message was delivered

◆ Pipeline_event() [3/3]

Pipeline_event::Pipeline_event ( Packet packet,
int  modifier = UNDEFINED_EVENT_MODIFIER,
enum_group_replication_consistency_level  consistency_level = GROUP_REPLICATION_CONSISTENCY_EVENTUAL,
Members_list online_members = nullptr 
)
inline

◆ ~Pipeline_event()

Pipeline_event::~Pipeline_event ( )
inline

Member Function Documentation

◆ convert_log_event_to_packet()

int Pipeline_event::convert_log_event_to_packet ( )
inlineprivate

Converts the existing log event into a packet.

Returns
the operation status
Return values
0OK
!=0Error on log event conversion

◆ convert_packet_to_log_event()

int Pipeline_event::convert_packet_to_log_event ( )
inlineprivate

Converts the existing packet into a log event.

Returns
the operation status
Return values
0OK
1Error on packet conversion

◆ get_applier_event_packet()

Packet * Pipeline_event::get_applier_event_packet ( )
inline

◆ get_consistency_level()

enum_group_replication_consistency_level Pipeline_event::get_consistency_level ( )
inline

Get transaction consistency level.

◆ get_event_context()

int Pipeline_event::get_event_context ( )
inline

Returns the event context flag.

◆ get_event_type()

mysql::binlog::event::Log_event_type Pipeline_event::get_event_type ( )
inline

Returns the event type.

Be it a Log_event or Packet, it's marked with a type we can extract.

Returns
the pipeline event type

◆ get_FormatDescription()

int Pipeline_event::get_FormatDescription ( Format_description_log_event **  out_fde)
inline

Return current format description event.

Parameters
[out]out_fdethe outputted format description event
Returns
Operation status
Return values
0OK

◆ get_LogEvent()

int Pipeline_event::get_LogEvent ( Log_event **  out_event)
inline

Return a log event.

If one does not exist, the contained packet will be converted into one.

Parameters
[out]out_eventthe outputted log event
Returns
Operation status
Return values
0OK
!=0error on conversion

◆ get_online_members()

Members_list * Pipeline_event::get_online_members ( )
inline

Get the list of ONLINE Group members when a Transaction_with_guarantee_message message was received, or NULL if if any group member version is from a version lower than TRANSACTION_WITH_GUARANTEES_VERSION.

For Transaction_message messages it always return NULL

Returns
list of all ONLINE members, if all members have version equal or greater than TRANSACTION_WITH_GUARANTEES_VERSION for Transaction_with_guarantee_message messages otherwise NULL
Note
the memory allocated for the list ownership belongs to the caller

◆ get_Packet()

int Pipeline_event::get_Packet ( Data_packet **  out_packet)
inline

Return a packet.

If one does not exist, the contained log event will be converted into one.

Parameters
[out]out_packetthe outputted packet
Returns
the operation status
Return values
0OK
!=0error on conversion

◆ get_pipeline_event_type()

Pipeline_event_type Pipeline_event::get_pipeline_event_type ( )
inline

◆ is_delayed_view_change_resumed()

bool Pipeline_event::is_delayed_view_change_resumed ( )
inline

Check if old view change processing is resumed.

Returns
is event being processed from queue
Return values
trueevent is being processed from queue
falseevent is not being processed from queue

◆ is_delayed_view_change_waiting_for_consistent_transactions()

bool Pipeline_event::is_delayed_view_change_waiting_for_consistent_transactions ( )
inline

Check if current view change is delayed due to consistent transaction.

Returns
is event being queued for later processing
Return values
trueevent is being queued
falseevent is not being queued

◆ mark_event()

void Pipeline_event::mark_event ( int  modifier)
inline

Sets the event context flag.

Parameters
[in]modifierthe event modifier

◆ release_online_members_memory_ownership()

void Pipeline_event::release_online_members_memory_ownership ( )
inline

Release memory ownership of m_online_members.

◆ reset_pipeline_event()

void Pipeline_event::reset_pipeline_event ( )
inline

Resets all variables in the event for reuse.

Possible existing events/packets are deleted. The context flag is reset to UNDEFINED. Error messages are deleted.

Format description events, are NOT deleted. This is due to the fact that they are given, and do not belong to the pipeline event.

Transaction consistency level is not reset, despite the event is reset, consistency level belongs to the transaction.

◆ set_delayed_view_change_resumed()

void Pipeline_event::set_delayed_view_change_resumed ( )
inline

Allow resume the log of delayed views that were waiting for consistent transactions from previous view to complete.

◆ set_delayed_view_change_waiting_for_consistent_transactions()

void Pipeline_event::set_delayed_view_change_waiting_for_consistent_transactions ( )
inline

Set view change cannot be processed now and should be delayed due to consistent transaction.

◆ set_LogEvent()

void Pipeline_event::set_LogEvent ( Log_event in_event)
inline

Sets the pipeline event's log event.

Note
This methods assume you have called reset_pipeline_event
Parameters
[in]in_eventthe given log event

◆ set_Packet()

void Pipeline_event::set_Packet ( Data_packet in_packet)
inline

Sets the pipeline event's packet.

Note
This methods assume you have called reset_pipeline_event
Parameters
[in]in_packetthe given packet

Member Data Documentation

◆ event_context

int Pipeline_event::event_context
private

◆ format_descriptor

Format_description_log_event* Pipeline_event::format_descriptor
private

◆ log_event

Log_event* Pipeline_event::log_event
private

◆ m_consistency_level

enum_group_replication_consistency_level Pipeline_event::m_consistency_level
private

◆ m_online_members

Members_list* Pipeline_event::m_online_members
private

◆ m_online_members_memory_ownership

bool Pipeline_event::m_online_members_memory_ownership
private

◆ m_packet_processing_state

Processing_state Pipeline_event::m_packet_processing_state {Processing_state::DEFAULT}
private

◆ m_processing_event_type

Pipeline_event_type Pipeline_event::m_processing_event_type
private

◆ packet

Data_packet* Pipeline_event::packet
private

◆ packet_event

Packet* Pipeline_event::packet_event {nullptr}
private

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