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