MySQL 8.3.0
Source Code Documentation
gcs_internal_message_headers.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef GCS_MSG_HEADERS_H
24#define GCS_MSG_HEADERS_H
25
26#include <limits>
27#include <memory>
28#include <sstream>
29#include <type_traits>
31
32/**
33 The different stages that are currently available.
34
35 Any time a new stage is created, the old stages must be added to this
36 enumeration class as new stages as follows. Let us assume that these
37 are the current stages:
38
39 enum class Stage_code : unsigned int {
40 ST_UNKNOWN = 0,
41
42 ST_LZ4_V1 = 1,
43
44 ST_LZ4_V2 = 2,
45
46 ST_SPLIT_V2 = 3,
47
48 ST_MAX_STAGES = 4
49 };
50
51 If a new stage is added meaning that the protocol has changed, the
52 enumeration class should be changed as follows:
53
54 enum class Stage_code : unsigned int {
55 ST_UNKNOWN = 0,
56
57 ST_LZ4_V1 = 1,
58
59 ST_LZ4_V2 = 2,
60
61 ST_SPLIT_V2 = 3,
62
63 ST_LZ4_V3 = 4,
64
65 ST_SPLIT_V3 = 5,
66
67 ST_NEW_V3 = 6,
68
69 ST_MAX_STAGES = 7
70 };
71 */
72enum class Stage_code : unsigned int {
73 /*
74 This type should not be used anywhere.
75 */
76 ST_UNKNOWN = 0,
77
78 /*
79 This type represents the compression stage v1.
80 */
81 ST_LZ4_V1 = 1,
82
83 /*
84 This type represents the compression stage v2.
85 */
86 ST_LZ4_V2 = 2,
87
88 /*
89 This type represents the split stage v2.
90 */
91 ST_SPLIT_V2 = 3,
92
93 /*
94 This type represents the compression stage v2.
95 */
96 ST_LZ4_V3 = 4,
97
98 /*
99 This type represents the split stage v2.
100 */
101 ST_SPLIT_V3 = 5,
102
103 /*
104 No valid state codes can appear after this one. If a stage code is to
105 be added, this value needs to be incremented and the lowest type code
106 available be assigned to the new stage.
107 */
108 ST_MAX_STAGES = 6
109};
110
111/**
112 The different cargo type codes.
113*/
114enum class Cargo_type : unsigned short {
115 /*
116 This type should not be used anywhere.
117 */
118 CT_UNKNOWN = 0,
119
120 /*
121 This cargo type is used for internal messaging related to stage
122 exchanges.
123 */
125
126 /*
127 This cargo type is used for messages from the application.
128 */
129 CT_USER_DATA = 2,
130
131 /*
132 No valid type codes can appear after this one. If a type code is to
133 be added, this value needs to be incremented and the lowest type code
134 available be assigned to the new type.
135 */
136 CT_MAX = 3
137};
138
139/**
140 This header is internal to the MySQL GCS library and contains metadata
141 information about the message content.
142
143 The on-the-wire representation of the fixed header is:
144
145 +------------------+-----------+------------------------------------------+
146 | field | wire size | description |
147 +==================+===========+==========================================+
148 | used_version | 2 bytes | protocol version in use by sender |
149 | max_version | 2 bytes | max protocol version supported by sender |
150 | fixed_hdr_len | 2 bytes | length of the fixed header |
151 | message_len | 8 bytes | length of the message |
152 | dyn_hdr_len | 4 bytes | length of the dynamic headers |
153 | cargo_type | 2 bytes | the cargo type in the payload |
154 +------------------+-----------+------------------------------------------+
155
156 Be aware that previously there was a single 4-byte version field.
157 Its semantics were the same of the used_version field.
158
159 Older nodes will continue to send messages that, from their point of view,
160 contain the single version field.
161 Older nodes only know protocol version 1.
162 Messages sent by older nodes will be encoded as follows:
163
164 used_version = 1 and max_version = 0
165
166 This is due to two factors:
167
168 1. The combined size of {used,max}_version is 4 bytes, which is the same
169 size of the old version field.
170 2. The fixed header is encoded in little endian. Therefore, the used_version
171 (max_version) field will contain the least (most) significant 2 bytes of
172 the old version field.
173
174 This class takes care of messages from old nodes by decoding such messages as:
175
176 used_version = 1 and max_version = 1
177*/
179 public:
180 /**
181 The used protocol version number length field.
182 */
183 static constexpr unsigned short WIRE_USED_VERSION_SIZE = 2;
184
185 /**
186 The maximum protocol version number length field.
187 */
188 static constexpr unsigned short WIRE_MAX_VERSION_SIZE = 2;
189
190 /**
191 The length of the combined version fields.
192 */
193 static constexpr unsigned short WIRE_VERSION_SIZE = 4;
194 static_assert(WIRE_VERSION_SIZE ==
196 "The two version fields must have a combined size of 4 bytes");
197
198 /**
199 On-the-wire size of the fixed header length field.
200 */
201 static constexpr unsigned short WIRE_HD_LEN_SIZE = 2;
202
203 /**
204 On-the-wire size of the message size field.
205 */
206 static constexpr unsigned short WIRE_TOTAL_LEN_SIZE = 8;
207
208 /**
209 On-the-wire size of the cargo type field.
210 */
211 static constexpr unsigned short WIRE_CARGO_TYPE_SIZE = 2;
212
213 /**
214 On-the-wire size of the dynamic headers length field.
215 */
216 static constexpr unsigned short WIRE_DYNAMIC_HDRS_LEN_SIZE = 4;
217
218 /**
219 On-the-wire offset of the dynamic headers length field.
220 */
221 static constexpr unsigned short WIRE_DYNAMIC_HDRS_LEN_OFFSET =
223
224 /**
225 On-the-wire offset of the message length field.
226 */
227 static constexpr unsigned short WIRE_MSG_LEN_OFFSET =
229
230 /**
231 On-the-wire size of the fixed header.
232 */
233 static constexpr unsigned short WIRE_TOTAL_FIXED_HEADER_SIZE =
236
237 private:
238 /**
239 The header instance used protocol version.
240 */
242 static_assert(sizeof(decltype(m_used_version)) == WIRE_USED_VERSION_SIZE,
243 "The m_used_version size does not match the storage capacity");
244
245 /**
246 The header instance maximum protocol version.
247 */
249 static_assert(sizeof(decltype(m_max_version)) == WIRE_MAX_VERSION_SIZE,
250 "The m_max_version size does not match the storage capacity");
251
252 static_assert(
253 sizeof(decltype(m_max_version)) + sizeof(decltype(m_used_version)) ==
255 "The m_{max,used}_version sizes does not match the storage capacity");
256
257 /**
258 The header instance length.
259 */
261 static_assert(
262 sizeof(decltype(m_fixed_header_len)) == WIRE_HD_LEN_SIZE,
263 "The m_fixed_header_len size does not match the storage capacity");
264
265 /**
266 The payload length field.
267
268 Note that we keep track of the total length indirectly and the storage
269 capacity is determined by the payload length which is the dominant factor.
270 */
271 unsigned long long m_payload_len{0};
272 static_assert(sizeof(decltype(m_payload_len)) <= WIRE_TOTAL_LEN_SIZE,
273 "The m_payload_len size does not match the storage capacity");
274
275 /**
276 The length of the dynamic headers.
277 */
278 unsigned int m_dynamic_headers_len{0};
279 static_assert(
281 "The m_dynamic_headers_len size does not match the storage capacity");
282
283 /**
284 The cargo type code.
285 */
287 static_assert(sizeof(decltype(m_cargo_type)) == WIRE_CARGO_TYPE_SIZE,
288 "The m_cargo_type size does not match the storage capacity");
289
290 public:
291 /**
292 Default constructor which is the only one provided.
293 */
294 explicit Gcs_internal_message_header() noexcept = default;
295
296 /**
297 These constructors are to be used when move semantics may be needed.
298 */
300 default;
302 Gcs_internal_message_header &&) noexcept = default;
303
304 /**
305 These constructors are to be used when copy semantics may be needed.
306 */
308 default;
310 const Gcs_internal_message_header &) noexcept = default;
311
312 /**
313 @return the value of the maximum protocol version field.
314 */
316
317 /**
318 @return the value of the used protocol version field.
319 */
321
322 /**
323 Set the maximum protocol version.
324
325 @param version Maximum protocol version.
326 */
328
329 /**
330 Set the current protocol version.
331
332 @param version Current protocol version.
333 */
335
336 /**
337 @return the value of the header length field value.
338 */
339 constexpr unsigned short get_fixed_header_length() const {
340 return m_fixed_header_len;
341 }
342
343 /**
344 @return the cargo type.
345 */
347
348 /**
349 Set the cargo type field value.
350
351 @param type Cargo type to set.
352 */
354
355 /**
356 @return The dynamic headers length field value.
357 */
358 unsigned int get_dynamic_headers_length() const;
359
360 /**
361 Set the dynamic headers length field value.
362
363 @param length The dynamic headers value.
364 */
365 void set_dynamic_headers_length(unsigned int length);
366
367 /**
368 Set the message length attribute value according to the payload length and
369 the header length. Only the payload information is provided because the
370 header length is fixed.
371
372 @param length Payload length.
373 */
374 void set_payload_length(unsigned long long length);
375
376 /**
377 @return The message total length field value.
378 */
379 unsigned long long get_total_length() const;
380
381 /**
382 Decode the contents of the buffer and sets the field values according to
383 the values decoded. The buffer MUST be encoded in little endian format.
384
385 @param buffer The buffer to decode from.
386 @return Length of decoded information in bytes.
387 */
388 unsigned long long decode(const unsigned char *buffer);
389
390 /**
391 Encode the contents of this instance into the buffer. The encoding SHALL
392 be done in little endian format.
393
394 @param buffer The buffer to encode to.
395 @return Length of encoded information in bytes.
396 */
397 unsigned long long encode(unsigned char *buffer) const;
398
399 /**
400 Create a string representation of the fixed header to be logged.
401
402 @param output Reference to the output stream where the string will be
403 created.
404 */
405 void dump(std::ostringstream &output) const;
406
407 static constexpr unsigned short calculate_length() {
409 }
410};
411
412/**
413 This is a default header created per stage and contains information to
414 decode it.
415
416 The on-the-wire-layout representation of a dynamic header is:
417
418 +------------------+-----------+--------------------------------------+
419 | field | wire size | description |
420 +==================+===========+======================================+
421 | dyn_hdr_len | 2 bytes | length of the dynamic header |
422 | stage_code | 4 bytes | stage code |
423 | old_payload_len | 8 bytes | length of the previous stage payload |
424 +------------------+-----------+--------------------------------------+
425*/
427 private:
428 /**
429 Dynamic header length.
430 */
431 unsigned short m_dynamic_header_length{0};
432
433 /**
434 Stage that created the dynamic header.
435 */
437
438 /**
439 Payload length when the packet went through the stage.
440 */
441 unsigned long long m_payload_length{0};
442
443 public:
444 /**
445 The offset of the header length within the stage header.
446 */
447 static constexpr unsigned short WIRE_HD_LEN_OFFSET = 0;
448
449 /**
450 On-the-wire field size for the stage type code.
451 */
452 static constexpr unsigned short WIRE_HD_LEN_SIZE = 2;
453
454 /**
455 The offset of the stage type code within the stage header.
456 */
457 static constexpr unsigned short WIRE_HD_TYPE_OFFSET = WIRE_HD_LEN_SIZE;
458
459 /**
460 On-the-wire field size for the stage type code.
461 */
462 static constexpr unsigned short WIRE_HD_TYPE_SIZE = 4;
463
464 /**
465 The offset of the payload length within the stage header.
466 */
467 static constexpr unsigned short WIRE_HD_PAYLOAD_LEN_OFFSET =
469
470 /**
471 On-the-wire field size for the stage payload length.
472 */
473 static constexpr unsigned short WIRE_HD_PAYLOAD_LEN_SIZE = 8;
474
475 /**
476 Constructor for the dynamic header.
477
478 @param stage_code Stage code.
479 @param payload_length Payload length while the packet is in the stage.
480 */
481 explicit Gcs_dynamic_header(Stage_code stage_code,
482 unsigned long long payload_length) noexcept;
483
484 /**
485 Default constructor is to be used when creating an empty dynamic header.
486 */
487 explicit Gcs_dynamic_header() noexcept = default;
488
489 /**
490 These constructors are to be used when move semantics may be needed.
491 */
493 Gcs_dynamic_header &operator=(Gcs_dynamic_header &&) noexcept = default;
494
495 /**
496 These constructors are to be used when copy semantics may be needed.
497 */
498 Gcs_dynamic_header(const Gcs_dynamic_header &) noexcept = default;
499 Gcs_dynamic_header &operator=(const Gcs_dynamic_header &) noexcept = default;
500
501 /**
502 Return the dynamic header length.
503 */
504 unsigned short get_dynamic_header_length() const;
505
506 /**
507 Return the stage code.
508 */
510
511 /**
512 Return the payload length the packet had before this stage was applied.
513 */
514 unsigned long long get_payload_length() const;
515
516 /**
517 Set the payload length the packet had before this stage was applied.
518
519 @param new_length payload length before this stage
520 */
521 void set_payload_length(unsigned long long new_length);
522
523 /**
524 Decode the contents of the buffer and sets the field values according to
525 the values decoded. The buffer MUST be encoded in little endian format.
526
527 @param buffer The buffer to decode from.
528 @return Length of decoded information in bytes.
529 */
530 unsigned long long decode(const unsigned char *buffer);
531
532 /**
533 Encode the contents of this instance into the buffer. The encoding SHALL
534 be done in little endian format.
535
536 @param buffer The buffer to encode to.
537 @return Length of encoded information in bytes.
538 */
539 unsigned long long encode(unsigned char *buffer) const;
540
541 /**
542 Return length of dynamic header.
543 */
544 static constexpr unsigned long long calculate_length() {
546 }
547
548 /**
549 Create a string representation of the dynamic header to be logged.
550
551 @param output Reference to the output stream where the string will be
552 created.
553 */
554 void dump(std::ostringstream &output) const;
555};
556
557/**
558 Abstract class that defines specific metadata associated to a stage if it
559 decides to extend it.
560 */
562 public:
564
566
569
572
573 /**
574 Creates a deep copy of this object.
575
576 @returns a deep copy of this object.
577 */
578 virtual std::unique_ptr<Gcs_stage_metadata> clone() = 0;
579
580 /**
581 Calculate the length required to encode this object.
582 */
583 virtual unsigned long long calculate_encode_length() const = 0;
584
585 /**
586 Encode the contents of this instance into the buffer. The encoding SHALL
587 be done in little endian format.
588
589 @param buffer The buffer to encode to.
590 @return Length of the encoded information.
591 */
592 virtual unsigned long long encode(unsigned char *buffer) const = 0;
593
594 /**
595 Decode the contents of the buffer and sets the field values according to
596 the values decoded. The buffer MUST be encoded in little endian format.
597
598 @param buffer The buffer to decode from.
599 @return Encoded size.
600 */
601 virtual unsigned long long decode(const unsigned char *buffer) = 0;
602
603 /**
604 Create a string representation of the header to be logged.
605
606 @param output Reference to the output stream where the string will be created
607 */
608 virtual void dump(std::ostringstream &output) const = 0;
609};
610
611/**
612 Empty metadata for stages that do not require any metadata.
613 */
615 public:
617
618 std::unique_ptr<Gcs_stage_metadata> clone() final;
619
620 unsigned long long calculate_encode_length() const final;
621
622 unsigned long long encode(unsigned char *) const final;
623
624 unsigned long long decode(unsigned char const *) final;
625
626 void dump(std::ostringstream &) const final;
627
630
633 default;
634};
635
636#endif // GCS_MSG_HEADERS_H
This is a default header created per stage and contains information to decode it.
Definition: gcs_internal_message_headers.h:426
unsigned long long m_payload_length
Payload length when the packet went through the stage.
Definition: gcs_internal_message_headers.h:441
static constexpr unsigned short WIRE_HD_PAYLOAD_LEN_OFFSET
The offset of the payload length within the stage header.
Definition: gcs_internal_message_headers.h:467
static constexpr unsigned short WIRE_HD_PAYLOAD_LEN_SIZE
On-the-wire field size for the stage payload length.
Definition: gcs_internal_message_headers.h:473
static constexpr unsigned short WIRE_HD_LEN_OFFSET
The offset of the header length within the stage header.
Definition: gcs_internal_message_headers.h:447
void set_payload_length(unsigned long long new_length)
Set the payload length the packet had before this stage was applied.
Definition: gcs_internal_message_headers.cc:214
unsigned short m_dynamic_header_length
Dynamic header length.
Definition: gcs_internal_message_headers.h:431
unsigned long long encode(unsigned char *buffer) const
Encode the contents of this instance into the buffer.
Definition: gcs_internal_message_headers.cc:218
unsigned long long decode(const unsigned char *buffer)
Decode the contents of the buffer and sets the field values according to the values decoded.
Definition: gcs_internal_message_headers.cc:251
unsigned short get_dynamic_header_length() const
Return the dynamic header length.
Definition: gcs_internal_message_headers.cc:204
static constexpr unsigned short WIRE_HD_TYPE_OFFSET
The offset of the stage type code within the stage header.
Definition: gcs_internal_message_headers.h:457
Stage_code m_stage_code
Stage that created the dynamic header.
Definition: gcs_internal_message_headers.h:436
unsigned long long get_payload_length() const
Return the payload length the packet had before this stage was applied.
Definition: gcs_internal_message_headers.cc:210
static constexpr unsigned long long calculate_length()
Return length of dynamic header.
Definition: gcs_internal_message_headers.h:544
static constexpr unsigned short WIRE_HD_LEN_SIZE
On-the-wire field size for the stage type code.
Definition: gcs_internal_message_headers.h:452
Gcs_dynamic_header() noexcept=default
Default constructor is to be used when creating an empty dynamic header.
Stage_code get_stage_code() const
Return the stage code.
Definition: gcs_internal_message_headers.cc:208
static constexpr unsigned short WIRE_HD_TYPE_SIZE
On-the-wire field size for the stage type code.
Definition: gcs_internal_message_headers.h:462
void dump(std::ostringstream &output) const
Create a string representation of the dynamic header to be logged.
Definition: gcs_internal_message_headers.cc:278
Empty metadata for stages that do not require any metadata.
Definition: gcs_internal_message_headers.h:614
unsigned long long encode(unsigned char *) const final
Encode the contents of this instance into the buffer.
Definition: gcs_internal_message_headers.cc:294
void dump(std::ostringstream &) const final
Create a string representation of the header to be logged.
Definition: gcs_internal_message_headers.cc:302
unsigned long long calculate_encode_length() const final
Calculate the length required to encode this object.
Definition: gcs_internal_message_headers.cc:290
std::unique_ptr< Gcs_stage_metadata > clone() final
Creates a deep copy of this object.
Definition: gcs_internal_message_headers.cc:286
Gcs_empty_stage_metadata()=default
unsigned long long decode(unsigned char const *) final
Decode the contents of the buffer and sets the field values according to the values decoded.
Definition: gcs_internal_message_headers.cc:298
This header is internal to the MySQL GCS library and contains metadata information about the message ...
Definition: gcs_internal_message_headers.h:178
void set_dynamic_headers_length(unsigned int length)
Set the dynamic headers length field value.
Definition: gcs_internal_message_headers.cc:64
Gcs_protocol_version m_max_version
The header instance maximum protocol version.
Definition: gcs_internal_message_headers.h:248
Gcs_protocol_version get_used_version() const
Definition: gcs_internal_message_headers.cc:38
constexpr unsigned short get_fixed_header_length() const
Definition: gcs_internal_message_headers.h:339
static constexpr unsigned short WIRE_DYNAMIC_HDRS_LEN_SIZE
On-the-wire size of the dynamic headers length field.
Definition: gcs_internal_message_headers.h:216
unsigned short m_fixed_header_len
The header instance length.
Definition: gcs_internal_message_headers.h:260
static constexpr unsigned short WIRE_MAX_VERSION_SIZE
The maximum protocol version number length field.
Definition: gcs_internal_message_headers.h:188
static constexpr unsigned short WIRE_CARGO_TYPE_SIZE
On-the-wire size of the cargo type field.
Definition: gcs_internal_message_headers.h:211
static constexpr unsigned short WIRE_HD_LEN_SIZE
On-the-wire size of the fixed header length field.
Definition: gcs_internal_message_headers.h:201
Gcs_internal_message_header() noexcept=default
Default constructor which is the only one provided.
Gcs_protocol_version get_maximum_version() const
Definition: gcs_internal_message_headers.cc:34
static constexpr unsigned short WIRE_USED_VERSION_SIZE
The used protocol version number length field.
Definition: gcs_internal_message_headers.h:183
static constexpr unsigned short WIRE_VERSION_SIZE
The length of the combined version fields.
Definition: gcs_internal_message_headers.h:193
static constexpr unsigned short WIRE_MSG_LEN_OFFSET
On-the-wire offset of the message length field.
Definition: gcs_internal_message_headers.h:227
static constexpr unsigned short calculate_length()
Definition: gcs_internal_message_headers.h:407
Cargo_type m_cargo_type
The cargo type code.
Definition: gcs_internal_message_headers.h:286
void set_used_version(Gcs_protocol_version version)
Set the current protocol version.
Definition: gcs_internal_message_headers.cc:47
void set_maximum_version(Gcs_protocol_version version)
Set the maximum protocol version.
Definition: gcs_internal_message_headers.cc:42
unsigned long long get_total_length() const
Definition: gcs_internal_message_headers.cc:74
static constexpr unsigned short WIRE_TOTAL_LEN_SIZE
On-the-wire size of the message size field.
Definition: gcs_internal_message_headers.h:206
Cargo_type get_cargo_type() const
Definition: gcs_internal_message_headers.cc:52
unsigned int m_dynamic_headers_len
The length of the dynamic headers.
Definition: gcs_internal_message_headers.h:278
void dump(std::ostringstream &output) const
Create a string representation of the fixed header to be logged.
Definition: gcs_internal_message_headers.cc:187
static constexpr unsigned short WIRE_DYNAMIC_HDRS_LEN_OFFSET
On-the-wire offset of the dynamic headers length field.
Definition: gcs_internal_message_headers.h:221
unsigned long long decode(const unsigned char *buffer)
Decode the contents of the buffer and sets the field values according to the values decoded.
Definition: gcs_internal_message_headers.cc:134
void set_cargo_type(Cargo_type type)
Set the cargo type field value.
Definition: gcs_internal_message_headers.cc:56
void set_payload_length(unsigned long long length)
Set the message length attribute value according to the payload length and the header length.
Definition: gcs_internal_message_headers.cc:69
unsigned long long m_payload_len
The payload length field.
Definition: gcs_internal_message_headers.h:271
unsigned long long encode(unsigned char *buffer) const
Encode the contents of this instance into the buffer.
Definition: gcs_internal_message_headers.cc:78
unsigned int get_dynamic_headers_length() const
Definition: gcs_internal_message_headers.cc:60
static constexpr unsigned short WIRE_TOTAL_FIXED_HEADER_SIZE
On-the-wire size of the fixed header.
Definition: gcs_internal_message_headers.h:233
Gcs_protocol_version m_used_version
The header instance used protocol version.
Definition: gcs_internal_message_headers.h:241
Abstract class that defines specific metadata associated to a stage if it decides to extend it.
Definition: gcs_internal_message_headers.h:561
Gcs_stage_metadata & operator=(const Gcs_stage_metadata &)=default
Gcs_stage_metadata()=default
virtual unsigned long long calculate_encode_length() const =0
Calculate the length required to encode this object.
virtual unsigned long long encode(unsigned char *buffer) const =0
Encode the contents of this instance into the buffer.
Gcs_stage_metadata(Gcs_stage_metadata &&)=default
Gcs_stage_metadata & operator=(Gcs_stage_metadata &&)=default
Gcs_stage_metadata(const Gcs_stage_metadata &)=default
virtual ~Gcs_stage_metadata()
virtual void dump(std::ostringstream &output) const =0
Create a string representation of the header to be logged.
virtual std::unique_ptr< Gcs_stage_metadata > clone()=0
Creates a deep copy of this object.
virtual unsigned long long decode(const unsigned char *buffer)=0
Decode the contents of the buffer and sets the field values according to the values decoded.
Cargo_type
The different cargo type codes.
Definition: gcs_internal_message_headers.h:114
@ CT_INTERNAL_STATE_EXCHANGE
Stage_code
The different stages that are currently available.
Definition: gcs_internal_message_headers.h:72
Gcs_protocol_version
The GCS protocol versions.
Definition: gcs_types.h:127
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:417
Definition: varlen_sort.h:174
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2869
required uint64 version
Definition: replication_group_member_actions.proto:40
required string type
Definition: replication_group_member_actions.proto:33