![]() |
MySQL 26.7.0
Source Code Documentation
|
Represents task schedule. More...
#include <task_schedule.h>
Public Member Functions | |
| Task_schedule () | |
| Constructor sets the task delay to a given value. More... | |
| bool | has_higher_priority (const Task_schedule &arg, int phase) const |
| Compare two task schedules to indicate which task should run first. More... | |
| virtual bool | next ()=0 |
| Determines whether to re-execute this schedule. More... | |
| virtual const Scheduler_clock_ptr & | get_clock () const =0 |
| Obtain task clock. More... | |
| virtual const Task_id & | get_id () const =0 |
| Obtain task id. More... | |
| virtual const Time_delay_type & | get_task_delay () const =0 |
| Obtains task execution point as a delay from the clock start. More... | |
| virtual bool | is_finished () const =0 |
| virtual | ~Task_schedule ()=default |
| Destructor. More... | |
| virtual const Scheduler_clock_ptr & | get_phase_clock (unsigned int) const |
| Obtain task clock for the given phase (current one by default) More... | |
| virtual const Time_delay_type & | get_phase_delay (unsigned int) const |
| Obtains task execution point as a delay from the clock start, but for the given phase (current one by default) More... | |
| virtual unsigned int | get_phase_id () const |
| Returns current phase id (sequence number), 0 by default. More... | |
| void | set_enqueued_by_scheduler () |
| Sets the flag indicating that the task was enqueued by the scheduler. More... | |
| bool | is_enqueued_by_scheduler () const |
| Checks if the task was enqueued by the scheduler. More... | |
| bool | is_phase_ready () const |
| Checks if the current phase is ready for execution. More... | |
| void | set_phase_ready () |
| Sets the phase ready flag to true. More... | |
Private Attributes | |
| std::atomic< bool > | m_phase_ready {false} |
| Flag indicating that a phase is ready to be executed. More... | |
| bool | m_enqueued_by_worker {true} |
| Flag inicating that phase will be enqueued by worker. More... | |
Represents task schedule.
This is the base class for a schedule
| mysql::scheduler::Task_schedule::Task_schedule | ( | ) |
Constructor sets the task delay to a given value.
|
virtualdefault |
Destructor.
|
pure virtual |
Obtain task clock.
Implemented in mysql::scheduler::Delayed_schedule, and mysql::scheduler::Transaction_order_schedule.
|
pure virtual |
Obtain task id.
Implemented in mysql::scheduler::Delayed_schedule, and mysql::scheduler::Transaction_order_schedule.
|
inlinevirtual |
Obtain task clock for the given phase (current one by default)
Reimplemented in mysql::scheduler::Transaction_order_schedule.
|
inlinevirtual |
Obtains task execution point as a delay from the clock start, but for the given phase (current one by default)
Gets information about task execution time - task delay since the beginning of a schedule
Reimplemented in mysql::scheduler::Transaction_order_schedule.
|
inlinevirtual |
Returns current phase id (sequence number), 0 by default.
Reimplemented in mysql::scheduler::Transaction_order_schedule.
|
pure virtual |
Obtains task execution point as a delay from the clock start.
Gets information about task execution time - task delay since the beginning of a schedule
Implemented in mysql::scheduler::Delayed_schedule, and mysql::scheduler::Transaction_order_schedule.
| bool mysql::scheduler::Task_schedule::has_higher_priority | ( | const Task_schedule & | arg, |
| int | phase | ||
| ) | const |
Compare two task schedules to indicate which task should run first.
Checks whether THIS task has higher priority than a given task in terms of time left to the execution
| arg | Task to compare against |
| phase | Compares task priority for a given phase (phase seqnence number) |
|
inline |
Checks if the task was enqueued by the scheduler.
|
pure virtual |
Implemented in mysql::scheduler::Delayed_schedule, and mysql::scheduler::Transaction_order_schedule.
|
inline |
Checks if the current phase is ready for execution.
|
pure virtual |
Determines whether to re-execute this schedule.
This function modifies the state of the schedule to next state
Implemented in mysql::scheduler::Delayed_schedule, and mysql::scheduler::Transaction_order_schedule.
|
inline |
Sets the flag indicating that the task was enqueued by the scheduler.
|
inline |
Sets the phase ready flag to true.
|
private |
Flag inicating that phase will be enqueued by worker.
|
private |
Flag indicating that a phase is ready to be executed.