MySQL 8.0.40
Source Code Documentation
mysqldump_tool_chain_maker.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef MYSQLDUMP_TOOL_CHAIN_MAKER_INCLUDED
27#define MYSQLDUMP_TOOL_CHAIN_MAKER_INCLUDED
28
29#include <functional>
30#include <map>
31#include <vector>
32
42#include "my_inttypes.h"
43
44namespace Mysql {
45namespace Tools {
46namespace Dump {
47
48/**
49 Chain maker implemented in Mysql_dump application, constructs chain based on
50 command line options that are compatible with these available in previous
51 implementation.
52 */
54 : public I_chain_maker,
57 public:
59 I_connection_provider *connection_provider,
60 std::function<bool(const Mysql::Tools::Base::Message_data &)>
61 *message_handler,
62 Simple_id_generator *object_id_generator,
65
67
69 I_dump_task *dump_task) override;
70
71 void delete_chain(uint64 chain_id, I_object_reader *chain) override;
72
73 // Fix "inherits ... via dominance" warnings
75 I_progress_watcher *new_progress_watcher) override {
77 }
78
79 // Fix "inherits ... via dominance" warnings
80 uint64 get_id() const override { return Abstract_chain_element::get_id(); }
81
82 protected:
83 // Fix "inherits ... via dominance" warnings
85 Item_processing_data *item_processed) override {
87 }
88
89 private:
90 void mysql_thread_callback(bool is_starting);
91
92 void stop_queues() override;
93
95
97 std::map<int, Object_queue *> m_object_queues;
98 std::vector<I_chain_element *> m_all_created_elements;
100};
101
102} // namespace Dump
103} // namespace Tools
104} // namespace Mysql
105
106#endif
Base class for all MySQL client tools.
Definition: abstract_program.h:47
Structure to represent message from server sent after executing query.
Definition: message_data.h:49
Definition: abstract_chain_element.h:45
void register_progress_watcher(I_progress_watcher *new_progress_watcher) override
Add new Progress Watcher to report to.
Definition: abstract_chain_element.h:58
uint64 get_id() const override
Returns an application unique ID of this chain element object.
Definition: abstract_chain_element.cc:36
void item_completion_in_child_callback(Item_processing_data *item_processed) override
This callback can be requested to be called by child for any object processing.
Definition: abstract_chain_element.cc:150
Definition: abstract_mysql_chain_element_extension.h:48
Definition: chain_data.h:35
Definition: i_chain_maker.h:38
Definition: i_connection_provider.h:38
Interface for all individual dump process tasks.
Definition: i_dump_task.h:38
Definition: i_object_reader.h:36
Definition: i_progress_watcher.h:37
Data structure for objects that are processed in any chain.
Definition: item_processing_data.h:43
Parses any DB object(excluding rows and privileges for DB objects) data using connection to MySQL ser...
Definition: mysql_object_reader.h:50
Definition: mysqldump_tool_chain_maker_options.h:44
Chain maker implemented in Mysql_dump application, constructs chain based on command line options tha...
Definition: mysqldump_tool_chain_maker.h:56
~Mysqldump_tool_chain_maker() override
Definition: mysqldump_tool_chain_maker.cc:179
void stop_queues() override
Definition: mysqldump_tool_chain_maker.cc:165
uint64 get_id() const override
Returns an application unique ID of this chain element object.
Definition: mysqldump_tool_chain_maker.h:80
Mysqldump_tool_chain_maker_options * m_options
Definition: mysqldump_tool_chain_maker.h:94
Mysqldump_tool_chain_maker(I_connection_provider *connection_provider, std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator, Mysqldump_tool_chain_maker_options *options, Mysql::Tools::Base::Abstract_program *program)
Definition: mysqldump_tool_chain_maker.cc:187
I_object_reader * create_chain(Chain_data *chain_data, I_dump_task *dump_task) override
Creates new chain for specified dump task.
Definition: mysqldump_tool_chain_maker.cc:47
std::map< int, Object_queue * > m_object_queues
Definition: mysqldump_tool_chain_maker.h:97
void register_progress_watcher(I_progress_watcher *new_progress_watcher) override
Add new Progress Watcher to report to.
Definition: mysqldump_tool_chain_maker.h:74
Mysql::Tools::Base::Abstract_program * m_program
Definition: mysqldump_tool_chain_maker.h:99
std::vector< I_chain_element * > m_all_created_elements
Definition: mysqldump_tool_chain_maker.h:98
void delete_chain(uint64 chain_id, I_object_reader *chain) override
Frees resources used by specified chain.
Definition: mysqldump_tool_chain_maker.cc:45
Mysql_object_reader * m_main_object_reader
Definition: mysqldump_tool_chain_maker.h:96
void item_completion_in_child_callback(Item_processing_data *item_processed) override
This callback can be requested to be called by child for any object processing.
Definition: mysqldump_tool_chain_maker.h:84
void mysql_thread_callback(bool is_starting)
Definition: mysqldump_tool_chain_maker.cc:172
Definition: simple_id_generator.h:37
Some integer typedefs for easier portability.
uint64_t uint64
Definition: my_inttypes.h:69
Definition: abstract_connection_program.h:38
Definition: options.cc:49