MySQL 26.7.0
Source Code Documentation
channel.h
Go to the documentation of this file.
1// Copyright (c) 2026, 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 MYSQL_CSA_CHANNEL_H
25#define MYSQL_CSA_CHANNEL_H
26
28
29namespace mysql::csa {
30
31/// @class Channel
32/// @brief Represents a channel in the Change Stream Applier (CSA).
33class Channel {
34 protected:
35 /// The name of the channel.
36 const std::string m_name;
37 /// Unique id of the channel
38 unsigned int m_instance_id{0};
39 /// Pointer to the commit order manager.
41
42 public:
43 /// Constructor
44 /// @param name Name of the channel
45 /// @param instance_id Unique id of the channel
46 /// @param commit_order_manager Pointer to the commit order manager
47 Channel(const std::string &name, unsigned int instance_id,
48 Commit_order_manager *commit_order_manager);
49 /// Destructor
50 virtual ~Channel();
51
52 /// Obtains the name of the channel
53 /// @return Channel name
54 const std::string &get_name() const;
55 /// Commit order manager accessor
56 /// @return Pointer to the commit order manager instance for this channel
58 unsigned int get_channel_id() const;
59};
60
61} // namespace mysql::csa
62
63#endif
On a replica and only on a replica, this class is responsible for committing the applied transactions...
Definition: rpl_replica_commit_order_manager.h:198
Represents a channel in the Change Stream Applier (CSA).
Definition: channel.h:33
unsigned int m_instance_id
Unique id of the channel.
Definition: channel.h:38
Commit_order_manager * m_commit_order_manager
Pointer to the commit order manager.
Definition: channel.h:40
Channel(const std::string &name, unsigned int instance_id, Commit_order_manager *commit_order_manager)
Constructor.
Definition: channel.cpp:30
const std::string m_name
The name of the channel.
Definition: channel.h:36
Commit_order_manager * get_commit_order_manager() const
Commit order manager accessor.
Definition: channel.cpp:38
virtual ~Channel()
Destructor.
Definition: channel.cpp:34
const std::string & get_name() const
Obtains the name of the channel.
Definition: channel.cpp:36
unsigned int get_channel_id() const
Definition: channel.cpp:42
Definition: channel.cpp:28