MySQL 8.0.39
Source Code Documentation
abstract_dump_task.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 ABSTRACT_DUMP_TASK_INCLUDED
27#define ABSTRACT_DUMP_TASK_INCLUDED
28
29#include <functional>
30#include <mutex>
31#include <vector>
32
35
36namespace Mysql {
37namespace Tools {
38namespace Dump {
39
40/**
41 Base class for most individual dump process tasks, not suitable for
42 lightweight dump tasks (e.g. Row).
43*/
45 public:
46 explicit Abstract_dump_task(Abstract_data_object *related_object);
47
49
50 I_data_object *get_related_db_object() const override;
51
52 std::vector<const Abstract_dump_task *> get_dependencies() const;
53
54 std::vector<Abstract_dump_task *> get_dependents() const;
55
56 void add_dependency(Abstract_dump_task *dependency);
57
58 bool can_be_executed() const override;
59
60 void set_completed() override;
61
62 /**
63 Registers callback to be called once this task is able to be executed.
64 */
66 std::function<void(const Abstract_dump_task *)> *availability_callback);
67
68 private:
70
72 std::vector<const Abstract_dump_task *> m_dependencies;
73 std::vector<Abstract_dump_task *> m_dependents;
74 std::vector<std::function<void(const Abstract_dump_task *)> *>
76 std::mutex m_task_mutex;
77};
78
79} // namespace Dump
80} // namespace Tools
81} // namespace Mysql
82
83#endif
Base class for all main DB objects.
Definition: abstract_data_object.h:41
Base class for most individual dump process tasks, not suitable for lightweight dump tasks (e....
Definition: abstract_dump_task.h:44
void add_dependency(Abstract_dump_task *dependency)
Definition: abstract_dump_task.cc:81
void set_completed() override
Sets task completed flag.
Definition: abstract_dump_task.cc:62
std::vector< const Abstract_dump_task * > get_dependencies() const
Definition: abstract_dump_task.cc:91
bool can_be_executed() const override
Returns true if task can start processing, for example when all dependencies are met.
Definition: abstract_dump_task.cc:71
std::vector< Abstract_dump_task * > m_dependents
Definition: abstract_dump_task.h:73
std::vector< std::function< void(const Abstract_dump_task *)> * > m_availability_callbacks
Definition: abstract_dump_task.h:75
std::mutex m_task_mutex
Definition: abstract_dump_task.h:76
std::vector< Abstract_dump_task * > get_dependents() const
Definition: abstract_dump_task.cc:87
I_data_object * get_related_db_object() const override
Definition: abstract_dump_task.cc:38
std::vector< const Abstract_dump_task * > m_dependencies
Definition: abstract_dump_task.h:72
void register_execution_availability_callback(std::function< void(const Abstract_dump_task *)> *availability_callback)
Registers callback to be called once this task is able to be executed.
Definition: abstract_dump_task.cc:56
Abstract_dump_task(Abstract_data_object *related_object)
Definition: abstract_dump_task.cc:33
Abstract_data_object * m_related_object
Definition: abstract_dump_task.h:71
void check_execution_availability()
Definition: abstract_dump_task.cc:42
Base class for all individual dump process tasks.
Definition: abstract_simple_dump_task.h:40
Definition: i_data_object.h:33
Definition: abstract_connection_program.h:38
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2874