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