24#ifndef MYSQL_SCHEDULER_TASK_SCHEDULE_H
25#define MYSQL_SCHEDULER_TASK_SCHEDULE_H
Represents the identifier of a task ingested by the scheduler,.
Definition: task_id.h:41
Represents task schedule.
Definition: task_schedule.h:45
bool has_higher_priority(const Task_schedule &arg, int phase) const
Compare two task schedules to indicate which task should run first.
Definition: task_schedule.cpp:33
virtual const Task_id & get_id() const =0
Obtain task id.
virtual const Scheduler_clock_ptr & get_clock() const =0
Obtain task clock.
bool is_enqueued_by_scheduler() const
Checks if the task was enqueued by the scheduler.
Definition: task_schedule.h:111
virtual ~Task_schedule()=default
Destructor.
virtual const Time_delay_type & get_task_delay() const =0
Obtains task execution point as a delay from the clock start.
Task_schedule()
Constructor sets the task delay to a given value.
Definition: task_schedule.cpp:31
virtual bool is_finished() const =0
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...
Definition: task_schedule.h:97
void set_enqueued_by_scheduler()
Sets the flag indicating that the task was enqueued by the scheduler.
Definition: task_schedule.h:107
void set_phase_ready()
Sets the phase ready flag to true.
Definition: task_schedule.h:118
virtual bool next()=0
Determines whether to re-execute this schedule.
virtual unsigned int get_phase_id() const
Returns current phase id (sequence number), 0 by default.
Definition: task_schedule.h:103
bool is_phase_ready() const
Checks if the current phase is ready for execution.
Definition: task_schedule.h:115
bool m_enqueued_by_worker
Flag inicating that phase will be enqueued by worker.
Definition: task_schedule.h:124
virtual const Scheduler_clock_ptr & get_phase_clock(unsigned int) const
Obtain task clock for the given phase (current one by default)
Definition: task_schedule.h:88
std::atomic< bool > m_phase_ready
Flag indicating that a phase is ready to be executed.
Definition: task_schedule.h:122
Definition: base_dependency_tracker.h:41
std::shared_ptr< Task_schedule > Task_schedule_ptr
Definition: task_schedule.h:41
std::uint64_t Time_delay_type
Time points are created as a delay from a specific start time (clock relative measure)
Definition: time.h:39
std::shared_ptr< Scheduler_clock > Scheduler_clock_ptr
Definition: scheduler_clock.h:36