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
33
#include "
client/dump/abstract_data_object.h
"
34
#include "
client/dump/abstract_simple_dump_task.h
"
35
36
namespace
Mysql
{
37
namespace
Tools {
38
namespace
Dump {
39
40
/**
41
Base class for most individual dump process tasks, not suitable for
42
lightweight dump tasks (e.g. Row).
43
*/
44
class
Abstract_dump_task
:
public
Abstract_simple_dump_task
{
45
public
:
46
explicit
Abstract_dump_task
(
Abstract_data_object
*related_object);
47
48
~Abstract_dump_task
()
override
;
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
*/
65
void
register_execution_availability_callback
(
66
std::function<
void
(
const
Abstract_dump_task
*)> *availability_callback);
67
68
private
:
69
void
check_execution_availability
();
70
71
Abstract_data_object
*
m_related_object
;
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
*)> *>
75
m_availability_callbacks
;
76
std::mutex
m_task_mutex
;
77
};
78
79
}
// namespace Dump
80
}
// namespace Tools
81
}
// namespace Mysql
82
83
#endif
abstract_data_object.h
abstract_simple_dump_task.h
Mysql::Tools::Dump::Abstract_data_object
Base class for all main DB objects.
Definition:
abstract_data_object.h:41
Mysql::Tools::Dump::Abstract_dump_task
Base class for most individual dump process tasks, not suitable for lightweight dump tasks (e....
Definition:
abstract_dump_task.h:44
Mysql::Tools::Dump::Abstract_dump_task::add_dependency
void add_dependency(Abstract_dump_task *dependency)
Definition:
abstract_dump_task.cc:81
Mysql::Tools::Dump::Abstract_dump_task::set_completed
void set_completed() override
Sets task completed flag.
Definition:
abstract_dump_task.cc:62
Mysql::Tools::Dump::Abstract_dump_task::get_dependencies
std::vector< const Abstract_dump_task * > get_dependencies() const
Definition:
abstract_dump_task.cc:91
Mysql::Tools::Dump::Abstract_dump_task::can_be_executed
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
Mysql::Tools::Dump::Abstract_dump_task::m_dependents
std::vector< Abstract_dump_task * > m_dependents
Definition:
abstract_dump_task.h:73
Mysql::Tools::Dump::Abstract_dump_task::m_availability_callbacks
std::vector< std::function< void(const Abstract_dump_task *)> * > m_availability_callbacks
Definition:
abstract_dump_task.h:75
Mysql::Tools::Dump::Abstract_dump_task::m_task_mutex
std::mutex m_task_mutex
Definition:
abstract_dump_task.h:76
Mysql::Tools::Dump::Abstract_dump_task::get_dependents
std::vector< Abstract_dump_task * > get_dependents() const
Definition:
abstract_dump_task.cc:87
Mysql::Tools::Dump::Abstract_dump_task::get_related_db_object
I_data_object * get_related_db_object() const override
Definition:
abstract_dump_task.cc:38
Mysql::Tools::Dump::Abstract_dump_task::m_dependencies
std::vector< const Abstract_dump_task * > m_dependencies
Definition:
abstract_dump_task.h:72
Mysql::Tools::Dump::Abstract_dump_task::~Abstract_dump_task
~Abstract_dump_task() override
Mysql::Tools::Dump::Abstract_dump_task::register_execution_availability_callback
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
Mysql::Tools::Dump::Abstract_dump_task::Abstract_dump_task
Abstract_dump_task(Abstract_data_object *related_object)
Definition:
abstract_dump_task.cc:33
Mysql::Tools::Dump::Abstract_dump_task::m_related_object
Abstract_data_object * m_related_object
Definition:
abstract_dump_task.h:71
Mysql::Tools::Dump::Abstract_dump_task::check_execution_availability
void check_execution_availability()
Definition:
abstract_dump_task.cc:42
Mysql::Tools::Dump::Abstract_simple_dump_task
Base class for all individual dump process tasks.
Definition:
abstract_simple_dump_task.h:40
Mysql::Tools::Dump::I_data_object
Definition:
i_data_object.h:33
Mysql
Definition:
abstract_connection_program.h:38
ut::vector
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition:
ut0new.h:2874
client
dump
abstract_dump_task.h
Generated by
1.9.2