MySQL  8.0.19
Source Code Documentation
Group_validation_message Class Reference

The base message for group validation messages. More...

#include <group_validation_message.h>

Inheritance diagram for Group_validation_message:
Plugin_gcs_message

Public Types

enum  enum_payload_item_type {
  PIT_UNKNOWN = 0, PIT_VALIDATION_TYPE = 1, PIT_VALIDATION_CHANNEL = 2, PIT_MEMBER_WEIGHT = 3,
  PIT_MAX
}
 Enum for message payload. More...
 
enum  enum_validation_message_type { GROUP_VALIDATION_UNKNOWN_MESSAGE = 0, ELECTION_VALIDATION_MESSAGE = 1, GROUP_VALIDATION_MESSAGE_END = 2 }
 Enum for the types of validation action. More...
 
- Public Types inherited from Plugin_gcs_message
enum  enum_cargo_type {
  CT_UNKNOWN = 0, CT_CERTIFICATION_MESSAGE = 1, CT_TRANSACTION_MESSAGE = 2, CT_RECOVERY_MESSAGE = 3,
  CT_MEMBER_INFO_MESSAGE = 4, CT_MEMBER_INFO_MANAGER_MESSAGE = 5, CT_PIPELINE_STATS_MEMBER_MESSAGE = 6, CT_SINGLE_PRIMARY_MESSAGE = 7,
  CT_GROUP_ACTION_MESSAGE = 8, CT_GROUP_VALIDATION_MESSAGE = 9, CT_SYNC_BEFORE_EXECUTION_MESSAGE = 10, CT_TRANSACTION_WITH_GUARANTEE_MESSAGE = 11,
  CT_TRANSACTION_PREPARED_MESSAGE = 12, CT_MESSAGE_SERVICE_MESSAGE = 13, CT_MAX = 14
}
 The different cargo type codes. More...
 

Public Member Functions

 Group_validation_message (bool has_channels, uint member_weight_arg)
 Class constructor. More...
 
 Group_validation_message (const uchar *buf, size_t len)
 Message constructor for raw data. More...
 
virtual ~Group_validation_message ()
 Class destructor. More...
 
bool has_slave_channels () const
 Does the member has running channels. More...
 
uint get_member_weight () const
 The election weight of this member. More...
 
- Public Member Functions inherited from Plugin_gcs_message
virtual ~Plugin_gcs_message ()
 
int get_version ()
 
unsigned short get_header_length ()
 
enum_cargo_type get_cargo_type () const
 
unsigned long long get_msg_length ()
 
void encode (std::vector< unsigned char > *buffer) const
 Encodes the contents of this instance into the buffer. More...
 
void decode (const unsigned char *buffer, size_t length)
 Decodes the contents of the buffer and sets the field values according to the values decoded. More...
 

Protected Member Functions

void encode_payload (std::vector< unsigned char > *buffer) const
 Encodes the message contents for transmission. More...
 
void decode_payload (const unsigned char *buffer, const unsigned char *)
 Message decoding method. More...
 
- Protected Member Functions inherited from Plugin_gcs_message
 Plugin_gcs_message (enum_cargo_type cargo_type)
 Plugin_gcs_message constructor. More...
 
void encode_payload_item_type_and_length (std::vector< unsigned char > *buffer, uint16 payload_item_type, unsigned long long payload_item_length) const
 Encodes the given payload item type and length into the buffer. More...
 
void encode_payload_item_char (std::vector< unsigned char > *buffer, uint16 type, unsigned char value) const
 Encodes the given payload item (type, length and value) into the buffer as a char (1 byte). More...
 
void encode_payload_item_int2 (std::vector< unsigned char > *buffer, uint16 type, uint16 value) const
 Encodes the given payload item (type, length and value) into the buffer as a 2 bytes integer. More...
 
void decode_payload_item_int2 (const unsigned char **buffer, uint16 *type, uint16 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 2 bytes integer. More...
 
void encode_payload_item_int4 (std::vector< unsigned char > *buffer, uint16 type, uint32 value) const
 Encodes the given payload item (type, length and value) into the buffer as a 4 bytes integer. More...
 
void decode_payload_item_int4 (const unsigned char **buffer, uint16 *type, uint32 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 4 bytes integer. More...
 
void encode_payload_item_int8 (std::vector< unsigned char > *buffer, uint16 type, ulonglong value) const
 Encodes the given payload item (type, length and value) into the buffer as a 8 bytes integer. More...
 
void decode_payload_item_int8 (const unsigned char **buffer, uint16 *type, uint64 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 8 bytes integer. More...
 
void encode_payload_item_string (std::vector< unsigned char > *buffer, uint16 type, const char *value, unsigned long long length) const
 Encodes the given payload item (type, length and value) into the buffer as a char array (variable size). More...
 
void decode_payload_item_string (const unsigned char **buffer, uint16 *type, std::string *value, unsigned long long *length)
 Decodes the given payload item (type, length and value) from the buffer as a char array (variable size). More...
 
void encode_payload_item_bytes (std::vector< unsigned char > *buffer, uint16 type, const unsigned char *value, unsigned long long length) const
 Encodes the given payload item (type, length and value) into the buffer as a byte buffer (variable size). More...
 
void decode_payload_item_bytes (const unsigned char **buffer, uint16 *type, unsigned char *value, unsigned long long *length)
 Decodes the given payload item (type, length and value) from the buffer as a byte buffer (variable size). More...
 

Private Attributes

enum_validation_message_type group_validation_message_type
 The message type. More...
 
bool has_channels
 Does the member has channels? More...
 
uint member_weight
 The member election weight. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Plugin_gcs_message
static enum_cargo_type get_cargo_type (const unsigned char *buffer)
 Return the cargo type of a given message buffer, without decode the complete message. More...
 
static void get_first_payload_item_raw_data (const unsigned char *buffer, const unsigned char **payload_item_data, size_t *payload_item_length)
 Return the raw data of the first payload item of a given message buffer, without decode the complete message. More...
 
- Static Public Attributes inherited from Plugin_gcs_message
static const int PLUGIN_GCS_MESSAGE_VERSION = 1
 The protocol version number. More...
 
static const unsigned int WIRE_VERSION_SIZE = 4
 The protocol version number. More...
 
static const unsigned int WIRE_HD_LEN_SIZE = 2
 The on-the-wire size of the header length field. More...
 
static const unsigned int WIRE_MSG_LEN_SIZE = 8
 The on-the-wire size of the message size field. More...
 
static const unsigned int WIRE_CARGO_TYPE_SIZE = 2
 The on-the-wire size of the cargo type field. More...
 
static const unsigned int WIRE_FIXED_HEADER_SIZE
 The on-the-wire size of the fixed header. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_TYPE_SIZE = 2
 The on-the-wire size of the each payload item type field. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_LEN_SIZE = 8
 The on-the-wire size of the each payload item size field. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_HEADER_SIZE
 The on-the-wire size of the payload item header. More...
 
- Static Protected Member Functions inherited from Plugin_gcs_message
static void decode_payload_item_type_and_length (const unsigned char **buffer, uint16 *payload_item_type, unsigned long long *payload_item_length)
 Decodes the given payload item type and length from the buffer. More...
 
static void decode_payload_item_char (const unsigned char **buffer, uint16 *type, unsigned char *value)
 Decodes the given payload item (type, length and value) from the buffer as a char (1 byte). More...
 

Detailed Description

The base message for group validation messages.

Member Enumeration Documentation

◆ enum_payload_item_type

Enum for message payload.

Enumerator
PIT_UNKNOWN 
PIT_VALIDATION_TYPE 
PIT_VALIDATION_CHANNEL 
PIT_MEMBER_WEIGHT 
PIT_MAX 

◆ enum_validation_message_type

Enum for the types of validation action.

Enumerator
GROUP_VALIDATION_UNKNOWN_MESSAGE 
ELECTION_VALIDATION_MESSAGE 
GROUP_VALIDATION_MESSAGE_END 

Constructor & Destructor Documentation

◆ Group_validation_message() [1/2]

Group_validation_message::Group_validation_message ( bool  has_channels,
uint  member_weight_arg 
)

Class constructor.

Parameters
has_channelsThis member has running slave channels?
member_weight_argThe election weight of this member

◆ Group_validation_message() [2/2]

Group_validation_message::Group_validation_message ( const uchar buf,
size_t  len 
)

Message constructor for raw data.

Parameters
[in]bufraw data
[in]lenraw length

◆ ~Group_validation_message()

Group_validation_message::~Group_validation_message ( )
virtual

Class destructor.

Member Function Documentation

◆ decode_payload()

void Group_validation_message::decode_payload ( const unsigned char *  buffer,
const unsigned char *   
)
protectedvirtual

Message decoding method.

Parameters
[in]bufferthe received data

Implements Plugin_gcs_message.

◆ encode_payload()

void Group_validation_message::encode_payload ( std::vector< unsigned char > *  buffer) const
protectedvirtual

Encodes the message contents for transmission.

Parameters
[out]bufferthe message buffer to be written

Implements Plugin_gcs_message.

◆ get_member_weight()

uint Group_validation_message::get_member_weight ( ) const

The election weight of this member.

Returns
The member weight

◆ has_slave_channels()

bool Group_validation_message::has_slave_channels ( ) const

Does the member has running channels.

Returns
true if yes, false otherwise

Member Data Documentation

◆ group_validation_message_type

enum_validation_message_type Group_validation_message::group_validation_message_type
private

The message type.

◆ has_channels

bool Group_validation_message::has_channels
private

Does the member has channels?

◆ member_weight

uint Group_validation_message::member_weight
private

The member election weight.


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