MySQL 8.3.0
Source Code Documentation
sync_before_execution_message.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 SYNC_BEFORE_EXECUTION_MESSAGE_INCLUDED
24#define SYNC_BEFORE_EXECUTION_MESSAGE_INCLUDED
25
27#include <vector>
28
29#include "my_inttypes.h"
31
32/*
33 @class Sync_before_execution_message
34 */
36 public:
38 // This type should not be used anywhere.
40
41 // Length of the payload item: 4 bytes
43
44 // Length of the payload item: 8 bytes
46
47 // No valid type codes can appear after this one.
48 PIT_MAX = 3
49 };
50
51 /**
52 Message constructor
53
54 @param[in] thread_id the thread that did the request
55 */
57
58 /**
59 Message decode constructor
60
61 @param[in] buf message buffer
62 @param[in] len message buffer length
63 */
64 Sync_before_execution_message(const unsigned char *buf, size_t len);
66
68
69 /**
70 Return the time at which the message contained in the buffer was sent.
71 @see Metrics_handler::get_current_time()
72
73 @param[in] buffer the buffer to decode from.
74 @param[in] length the buffer length
75
76 @return the time on which the message was sent.
77 */
78 static uint64_t get_sent_timestamp(const unsigned char *buffer,
79 size_t length);
80
81 protected:
82 /*
83 Implementation of the template methods
84 */
85 void encode_payload(std::vector<unsigned char> *buffer) const override;
86 void decode_payload(const unsigned char *buffer,
87 const unsigned char *end) override;
88
89 private:
91};
92
93#endif /* SYNC_BEFORE_EXECUTION_MESSAGE_INCLUDED */
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:63
Definition: sync_before_execution_message.h:35
void encode_payload(std::vector< unsigned char > *buffer) const override
Encodes the contents of this instance payload into the buffer.
Definition: sync_before_execution_message.cc:40
static uint64_t get_sent_timestamp(const unsigned char *buffer, size_t length)
Return the time at which the message contained in the buffer was sent.
Definition: sync_before_execution_message.cc:66
~Sync_before_execution_message() override
void decode_payload(const unsigned char *buffer, const unsigned char *end) override
Decodes the contents of the buffer and sets the payload field values according to the values decoded.
Definition: sync_before_execution_message.cc:51
enum_payload_item_type
Definition: sync_before_execution_message.h:37
@ PIT_UNKNOWN
Definition: sync_before_execution_message.h:39
@ PIT_MY_THREAD_ID
Definition: sync_before_execution_message.h:42
@ PIT_MAX
Definition: sync_before_execution_message.h:48
@ PIT_SENT_TIMESTAMP
Definition: sync_before_execution_message.h:45
my_thread_id m_thread_id
Definition: sync_before_execution_message.h:90
my_thread_id get_thread_id()
Definition: sync_before_execution_message.cc:62
Sync_before_execution_message(my_thread_id thread_id)
Message constructor.
Definition: sync_before_execution_message.cc:27
Some integer typedefs for easier portability.
static my_thread_id thread_id
Definition: my_thr_init.cc:62
uint32 my_thread_id
Definition: my_thread_local.h:33
Definition: buf0block_hint.cc:29
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
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191