![]() |
MySQL 26.7.0
Source Code Documentation
|
A task that executes a job in the change streams apply system. More...
#include <task_exec_job.h>
Public Types | |
| using | Task_result = mysql::scheduler::Task_result |
| Type alias for the task result from the mysql scheduler. More... | |
| using | Session_service_ptr = mysql::csa::Session_service_ptr |
| Type alias for the session service in change streams apply. More... | |
| using | Stat_monitor_ref = scheduler::Statistics_instance_monitor_ref |
| Type alias for the statistics monitor instance for the channel. More... | |
Public Member Functions | |
| bool | is_error () const |
| Checks if task executed with an error - this function is called by Scheduler to get task status. More... | |
| Task_exec_job (Job_ptr job, uint64_t job_id, Session_service_ptr session_service, Stat_monitor_ref stat_monitor, std::atomic< bool > &stop_ref) | |
| Constructor. More... | |
| Task_result | operator() (unsigned int thread_id) |
| This function executes a job. More... | |
Private Member Functions | |
| Task_result | run (Job *job, uint64_t job_id, unsigned int thread_id) |
| Function executing a job - internal implementation. More... | |
| void | set_error () |
| Indicates that a task executed with a non-recoverable error (stop) More... | |
Private Attributes | |
| bool | m_is_error {false} |
| Internal error flag. More... | |
| std::shared_ptr< Job > | m_job |
| Shared job handle provided by the job provider. More... | |
| uint64_t | m_job_id {0} |
| Job id assigned by the job provider. More... | |
| Session_service_ptr | m_session_service |
| Assigned session service handle. More... | |
| bool | m_started {false} |
| Checks if task has been started. More... | |
| scheduler::Statistics_instance_monitor_ref | m_stat_monitor |
| Statistics monitoring object for the current instance. More... | |
| std::atomic< bool > & | m_applier_stop |
| If retried, this flag will be checked to determine whether applier has been stopped. More... | |
A task that executes a job in the change streams apply system.
It handles job execution, potential retries on failures, and error management.
Type alias for the session service in change streams apply.
Type alias for the statistics monitor instance for the channel.
Type alias for the task result from the mysql scheduler.
| mysql::csa::Task_exec_job::Task_exec_job | ( | Job_ptr | job, |
| uint64_t | job_id, | ||
| Session_service_ptr | session_service, | ||
| Stat_monitor_ref | stat_monitor, | ||
| std::atomic< bool > & | stop_ref | ||
| ) |
Constructor.
| job | Job handle created by the job provider |
| job_id | Job id assigned by the job provider |
| session_service | Handle to session service, providing sessions to which this job can attach. |
| stat_monitor | Statistic monitoring object |
| stop_ref | If retried, this flag will be checked to determine whether applier has been stopped. Otherwise, we skip this check for performance |
| bool mysql::csa::Task_exec_job::is_error | ( | ) | const |
Checks if task executed with an error - this function is called by Scheduler to get task status.
| Task_result mysql::csa::Task_exec_job::operator() | ( | unsigned int | thread_id | ) |
This function executes a job.
If job fails and can be retried, job is reexecuted. In case retry fails or is not possible, error is written into the job, function returns an error, causing scheduler to stop
|
private |
Function executing a job - internal implementation.
| job | Job pointer |
| job_id | Internal job identifier |
| thread_id | Thread pool worker identifier |
This is early return for multiple phase tasks returning in early phases
|
private |
Indicates that a task executed with a non-recoverable error (stop)
|
private |
If retried, this flag will be checked to determine whether applier has been stopped.
Otherwise, we skip this check for performance
|
private |
Internal error flag.
|
private |
Shared job handle provided by the job provider.
|
private |
Job id assigned by the job provider.
|
private |
Assigned session service handle.
|
private |
Checks if task has been started.
|
private |
Statistics monitoring object for the current instance.