MySQL 26.7.0
Source Code Documentation
schedule_factory.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_SCHEDULER_SCHEDULE_FACTORY_H
25#define MYSQL_SCHEDULER_SCHEDULE_FACTORY_H
26
30
31namespace mysql::scheduler {
32
33/// @class Schedule_factory
34/// @brief Schedule factory class - creates task schedule object pointer based
35/// on input parameters
36/// @details Creates tasks starting from arbitrary point of time (steady_clock
37/// point of time)
39 public:
40 /// @brief Constructor
41 /// @param clock_ptr Clock based on which schedules will be created
43
44 /// @param clock_ptr Clock based on which schedules will be created
45 /// @param phase_clock Clock based on which schedule for the second task
46 /// phase will be created (to support Transaction_order_schedule)
48 Scheduler_clock_ptr phase_clock);
49
50 /// @brief create
51 /// @details Creates one-shot task schedule
52 Task_schedule_ptr create(Task_id task_id, uint64_t delay) const;
53
54 /// @brief clock disabled
55 /// @details Creates one-shot task schedule
56 Task_schedule_ptr create(Task_id task_id) const;
57
58 /// @details Creates transaction task schedule
59 Task_schedule_ptr create(Task_id task_id, uint64_t delay, bool is_trx);
60
61 /// @brief Destructor
62 virtual ~Schedule_factory() = default;
63
64 private:
67 uint64_t m_phase_delay{0};
68};
69
70} // namespace mysql::scheduler
71
72#endif // MYSQL_SCHEDULER_SCHEDULE_FACTORY_H
Schedule factory class - creates task schedule object pointer based on input parameters.
Definition: schedule_factory.h:38
uint64_t m_phase_delay
Definition: schedule_factory.h:67
Task_schedule_ptr create(Task_id task_id, uint64_t delay) const
create
Definition: schedule_factory.cpp:40
Scheduler_clock_ptr m_phase_clock
Definition: schedule_factory.h:66
Schedule_factory(Scheduler_clock_ptr clock_ptr)
Constructor.
Definition: schedule_factory.cpp:33
virtual ~Schedule_factory()=default
Destructor.
Scheduler_clock_ptr m_clock
Definition: schedule_factory.h:65
Represents the identifier of a task ingested by the scheduler,.
Definition: task_id.h:41
Definition: base_dependency_tracker.h:41
std::shared_ptr< Task_schedule > Task_schedule_ptr
Definition: task_schedule.h:41
std::shared_ptr< Scheduler_clock > Scheduler_clock_ptr
Definition: scheduler_clock.h:36