MySQL 8.3.0
Source Code Documentation
abstract_dump_task.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2023, 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 also distributed 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 included with MySQL.
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
25#ifndef ABSTRACT_DUMP_TASK_INCLUDED
26#define ABSTRACT_DUMP_TASK_INCLUDED
27
28#include <functional>
29#include <mutex>
30#include <vector>
31
34
35namespace Mysql {
36namespace Tools {
37namespace Dump {
38
39/**
40 Base class for most individual dump process tasks, not suitable for
41 lightweight dump tasks (e.g. Row).
42*/
44 public:
45 explicit Abstract_dump_task(Abstract_data_object *related_object);
46
48
49 I_data_object *get_related_db_object() const override;
50
51 std::vector<const Abstract_dump_task *> get_dependencies() const;
52
53 std::vector<Abstract_dump_task *> get_dependents() const;
54
55 void add_dependency(Abstract_dump_task *dependency);
56
57 bool can_be_executed() const override;
58
59 void set_completed() override;
60
61 /**
62 Registers callback to be called once this task is able to be executed.
63 */
65 std::function<void(const Abstract_dump_task *)> *availability_callback);
66
67 private:
69
71 std::vector<const Abstract_dump_task *> m_dependencies;
72 std::vector<Abstract_dump_task *> m_dependents;
73 std::vector<std::function<void(const Abstract_dump_task *)> *>
75 std::mutex m_task_mutex;
76};
77
78} // namespace Dump
79} // namespace Tools
80} // namespace Mysql
81
82#endif
Base class for all main DB objects.
Definition: abstract_data_object.h:40
Base class for most individual dump process tasks, not suitable for lightweight dump tasks (e....
Definition: abstract_dump_task.h:43
void add_dependency(Abstract_dump_task *dependency)
Definition: abstract_dump_task.cc:80
void set_completed() override
Sets task completed flag.
Definition: abstract_dump_task.cc:61
std::vector< const Abstract_dump_task * > get_dependencies() const
Definition: abstract_dump_task.cc:90
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:70
std::vector< Abstract_dump_task * > m_dependents
Definition: abstract_dump_task.h:72
std::vector< std::function< void(const Abstract_dump_task *)> * > m_availability_callbacks
Definition: abstract_dump_task.h:74
std::mutex m_task_mutex
Definition: abstract_dump_task.h:75
std::vector< Abstract_dump_task * > get_dependents() const
Definition: abstract_dump_task.cc:86
I_data_object * get_related_db_object() const override
Definition: abstract_dump_task.cc:37
std::vector< const Abstract_dump_task * > m_dependencies
Definition: abstract_dump_task.h:71
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:55
Abstract_dump_task(Abstract_data_object *related_object)
Definition: abstract_dump_task.cc:32
Abstract_data_object * m_related_object
Definition: abstract_dump_task.h:70
void check_execution_availability()
Definition: abstract_dump_task.cc:41
Base class for all individual dump process tasks.
Definition: abstract_simple_dump_task.h:39
Definition: i_data_object.h:32
Definition: abstract_connection_program.h:39
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2873