MySQL 26.7.0
Source Code Documentation
cs::apply::Parallel_worker_context Class Referenceabstract

Class representing the interface for parallel worker context. More...

#include <parallel_worker_context.h>

Inheritance diagram for cs::apply::Parallel_worker_context:
[legend]

Public Types

using Trx_id = int64_t
 
using Worker_id = uint64_t
 
using Channel_id = std::string
 

Public Member Functions

 Parallel_worker_context ()=default
 
virtual ~Parallel_worker_context ()=default
 
virtual void report_commit_order_deadlock (bool for_self=false)=0
 Indicates that commit order deadlock has been found. More...
 
virtual bool found_commit_order_deadlock () const =0
 Checks if commit order deadlock has been found. More...
 
virtual void reset_commit_order_deadlock ()=0
 Resets commit order deadlock. More...
 
virtual bool is_same_channel (const Parallel_worker_context *other) const =0
 Checks if arg parallel worker executes transaction coming from the same channel. More...
 
virtual THDget_transaction_ctx ()=0
 Returns transaction id (we use sequence number) More...
 
virtual instruments::Worker_metricsget_worker_metrics ()=0
 Obtains worker metrics. More...
 
virtual Worker_id get_worker_id () const =0
 Returns worker id. More...
 
virtual MDL_contextget_mdl_context ()=0
 Obtains MDL context needed for commit. More...
 
virtual bool can_be_retried (THD *thd)=0
 Returns information on whether THD transaction can be retried. More...
 
virtual Trx_id get_trx_id ()=0
 Obtain transaction id (sequence number) More...
 
virtual const char * get_for_channel_id (bool) const
 Get "for channel" id. More...
 
virtual bool is_csa () const
 Checks whether this worker is CSA worker. More...
 

Detailed Description

Class representing the interface for parallel worker context.

It accesses basic information like worker id, transaction id, channel id and other functionatlities needed by the commit order manager.

Note
This context is needed to disconnect Slave_worker class from execution path, Slave_worker implements Parallel_worker_context interface

Member Typedef Documentation

◆ Channel_id

◆ Trx_id

◆ Worker_id

Constructor & Destructor Documentation

◆ Parallel_worker_context()

cs::apply::Parallel_worker_context::Parallel_worker_context ( )
default

◆ ~Parallel_worker_context()

virtual cs::apply::Parallel_worker_context::~Parallel_worker_context ( )
virtualdefault

Member Function Documentation

◆ can_be_retried()

virtual bool cs::apply::Parallel_worker_context::can_be_retried ( THD thd)
pure virtual

Returns information on whether THD transaction can be retried.

Returns
true if transaction can be retried

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ found_commit_order_deadlock()

virtual bool cs::apply::Parallel_worker_context::found_commit_order_deadlock ( ) const
pure virtual

Checks if commit order deadlock has been found.

Returns
True if commit order deadlock has been found, false otherwise

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ get_for_channel_id()

virtual const char * cs::apply::Parallel_worker_context::get_for_channel_id ( bool  ) const
inlinevirtual

Get "for channel" id.

Builds string in flight when needed Pass true as boolean argument if upper case is needed

Returns
"for channel" string

Reimplemented in cs::apply::Csa_worker_context.

◆ get_mdl_context()

virtual MDL_context * cs::apply::Parallel_worker_context::get_mdl_context ( )
pure virtual

Obtains MDL context needed for commit.

Returns
MDL context

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ get_transaction_ctx()

virtual THD * cs::apply::Parallel_worker_context::get_transaction_ctx ( )
pure virtual

Returns transaction id (we use sequence number)

Returns
transaction id

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ get_trx_id()

virtual Trx_id cs::apply::Parallel_worker_context::get_trx_id ( )
pure virtual

Obtain transaction id (sequence number)

Returns
Transaction sequence number

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ get_worker_id()

virtual Worker_id cs::apply::Parallel_worker_context::get_worker_id ( ) const
pure virtual

Returns worker id.

Returns
Worker identifier

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ get_worker_metrics()

virtual instruments::Worker_metrics & cs::apply::Parallel_worker_context::get_worker_metrics ( )
pure virtual

Obtains worker metrics.

Returns
Reference to worker metrics object

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ is_csa()

virtual bool cs::apply::Parallel_worker_context::is_csa ( ) const
inlinevirtual

Checks whether this worker is CSA worker.

Returns
true for CSA parallel worker context. False otherwise

Reimplemented in cs::apply::Csa_worker_context.

◆ is_same_channel()

virtual bool cs::apply::Parallel_worker_context::is_same_channel ( const Parallel_worker_context other) const
pure virtual

Checks if arg parallel worker executes transaction coming from the same channel.

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ report_commit_order_deadlock()

virtual void cs::apply::Parallel_worker_context::report_commit_order_deadlock ( bool  for_self = false)
pure virtual

Indicates that commit order deadlock has been found.

Parameters
for_selfWhen true, a thread reports for its own

Implemented in cs::apply::Csa_worker_context, and Slave_worker.

◆ reset_commit_order_deadlock()

virtual void cs::apply::Parallel_worker_context::reset_commit_order_deadlock ( )
pure virtual

Resets commit order deadlock.

Implemented in cs::apply::Csa_worker_context, and Slave_worker.


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