MySQL 26.7.0
Source Code Documentation
mysql::scheduler::Commit_order_clock Class Reference

#include <commit_order_clock.h>

Inheritance diagram for mysql::scheduler::Commit_order_clock:
[legend]

Public Types

using Time_point_t = uint64_t
 
- Public Types inherited from mysql::scheduler::Scheduler_clock
using Time_point_t = uint64_t
 

Public Member Functions

 Commit_order_clock (Time_point_t start_point=0)
 Constructor. More...
 
Time_point_t start_time () const override
 Gets clock start time. More...
 
Time_point_t now () const override
 Gets current time, i.e. More...
 
bool add_time (Task_id task_id, Time_point_t time) override
 Subscribes a task to time processing window. More...
 
bool tick (Task_id task_id, Time_point_t time) override
 Notify that task finished execution. More...
 
Scheduler_dependency_type get_type () const override
 This clock dependency type is start-to-start. More...
 
- Public Member Functions inherited from mysql::scheduler::Scheduler_clock
virtual ~Scheduler_clock ()=default
 Destructor. More...
 
virtual bool advances_independently () const
 Returns property of a clock - information on whether this clock is steered by task ticks or advances independently. More...
 
virtual bool try_unblock ()
 Maintenance function for unblocking the clock. More...
 

Private Attributes

std::atomic< Time_point_tm_clock {0}
 Current clock value (now / delay from the start point) More...
 
std::atomic< std::size_t > m_twicked_count {0}
 Used to track stalled clock unblocking (clock was twicked by this count) More...
 

Member Typedef Documentation

◆ Time_point_t

Constructor & Destructor Documentation

◆ Commit_order_clock()

mysql::scheduler::Commit_order_clock::Commit_order_clock ( Time_point_t  start_point = 0)

Constructor.

Parameters
start_pointClock start point (set as now time)

Member Function Documentation

◆ add_time()

bool mysql::scheduler::Commit_order_clock::add_time ( Task_id  task_id,
Time_point_t  time 
)
overridevirtual

Subscribes a task to time processing window.

Parameters
task_idUnused task ID
timeTime window to which a task will be subscribed
Returns
True if task has been subscribed, false otherwise

Implements mysql::scheduler::Scheduler_clock.

◆ get_type()

Scheduler_dependency_type mysql::scheduler::Commit_order_clock::get_type ( ) const
inlineoverridevirtual

This clock dependency type is start-to-start.

Reimplemented from mysql::scheduler::Scheduler_clock.

◆ now()

Commit_order_clock::Time_point_t mysql::scheduler::Commit_order_clock::now ( ) const
overridevirtual

Gets current time, i.e.

current processing window value

Returns
Current time, i.e. current processing window value

Implements mysql::scheduler::Scheduler_clock.

◆ start_time()

Commit_order_clock::Time_point_t mysql::scheduler::Commit_order_clock::start_time ( ) const
overridevirtual

Gets clock start time.

Returns
Start time

Implements mysql::scheduler::Scheduler_clock.

◆ tick()

bool mysql::scheduler::Commit_order_clock::tick ( Task_id  task_id,
Time_point_t  time 
)
overridevirtual

Notify that task finished execution.

Called by asynchronous workers executing task. When specific conditions are met, tick will advance the internal clock value.

Parameters
task_idUnused task ID
timeDelay value the task was subscribed to
Returns
True if time advanced, false otherwise

Implements mysql::scheduler::Scheduler_clock.

Member Data Documentation

◆ m_clock

std::atomic<Time_point_t> mysql::scheduler::Commit_order_clock::m_clock {0}
private

Current clock value (now / delay from the start point)

◆ m_twicked_count

std::atomic<std::size_t> mysql::scheduler::Commit_order_clock::m_twicked_count {0}
private

Used to track stalled clock unblocking (clock was twicked by this count)


The documentation for this class was generated from the following files: