MySQL 8.0.39
Source Code Documentation
Mysql::Tools::Dump::Abstract_chain_element Class Reference

#include <abstract_chain_element.h>

Inheritance diagram for Mysql::Tools::Dump::Abstract_chain_element:
[legend]

Public Member Functions

uint64 get_id () const override
 Returns an application unique ID of this chain element object. More...
 
Abstract_chain_elementoperator= (Abstract_chain_element &&other)=delete
 Disable move assignment to avoid Wvirtual-move-assign warning. More...
 
void register_progress_watcher (I_progress_watcher *new_progress_watcher) override
 Add new Progress Watcher to report to. More...
 
- Public Member Functions inherited from Mysql::Tools::Dump::I_chain_element
 ~I_chain_element () override
 
- Public Member Functions inherited from Mysql::Tools::Dump::I_progress_reporter
virtual ~I_progress_reporter ()
 
- Public Member Functions inherited from Mysql::Tools::Dump::Abstract_progress_reporter
void register_progress_watcher (I_progress_watcher *new_progress_watcher) override
 Add new Progress Watcher to report to. More...
 

Protected Member Functions

 Abstract_chain_element (std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator)
 
template<typename TType , typename TClass >
bool try_process_task (Item_processing_data *item_to_process, void(TClass::*processing_func)(TType *, Item_processing_data *))
 Process task object with specified function if that task object can be casted to type TType. More...
 
template<typename TType , typename TClass >
bool try_process_task (Item_processing_data *item_to_process, void(TClass::*processing_func)(TType *))
 Process task object with specified function if that task object can be casted to type TType. More...
 
void object_processing_starts (Item_processing_data *item_to_process)
 
Item_processing_dataobject_to_be_processed_in_child (Item_processing_data *current_item_data, I_chain_element *child_chain_element)
 
Item_processing_datanew_task_created (I_dump_task *dump_task_created)
 
Item_processing_datanew_chain_created (Chain_data *new_chain_data, Item_processing_data *parent_processing_data, I_chain_element *child_chain_element)
 
Item_processing_datanew_chain_created (Item_processing_data *current_item_data, I_dump_task *dump_task_created)
 
void object_processing_ends (Item_processing_data *processed_item)
 
uint64 generate_new_object_id ()
 
Simple_id_generatorget_object_id_generator () const
 
void pass_message (const Mysql::Tools::Base::Message_data &message_data)
 Passes message to message callback. More...
 
std::function< bool(const Mysql::Tools::Base::Message_data &)> * get_message_handler () const
 
virtual bool need_callbacks_in_child ()
 
void item_completion_in_child_callback (Item_processing_data *item_processed) override
 This callback can be requested to be called by child for any object processing. More...
 
- Protected Member Functions inherited from Mysql::Tools::Dump::Abstract_progress_reporter
bool have_progress_watcher ()
 Specifies if have any Progress Watcher registered. More...
 
void report_new_chain_created (Item_processing_data *new_chain_creator)
 Reports new non-empty chain being created by Chain Maker or new row fetched from table by Table Reader. More...
 
void report_object_processing_started (Item_processing_data *process_data)
 Report new object(table, row or any other) was started processing by specified Object Reader, Table Reader, Formatter or Row Formatter. More...
 
void report_object_processing_ended (Item_processing_data *finished_process_data)
 Report object(table, row or any other) finished being processed. More...
 
virtual void report_crawler_completed (I_crawler *crawler)
 Reports crawler ended enumerating objects and creating chains for them. More...
 
void register_progress_watchers_in_child (I_progress_reporter *reporter)
 

Private Member Functions

void item_completion_in_child_callback_wrapper (Item_processing_data *item_processed)
 Wrapper on item_completion_in_child_callback which allows creation of pointer to function which will then fetch correct virtual method pointer. More...
 
void item_completion_in_child_completes_task_callback (Item_processing_data *item_processed)
 Wrapper on item_completion_in_child_callback_wrapper which also sets precessed task to be fully completed. More...
 
Item_processing_datatask_to_be_processed_in_child (Item_processing_data *current_item_data, I_chain_element *child_chain_element, I_dump_task *task_to_be_processed, std::function< void(Item_processing_data *)> *callback)
 

Private Attributes

uint64 m_id
 
std::function< bool(const Mysql::Tools::Base::Message_data &)> * m_message_handler
 
std::function< void(Item_processing_data *)> m_item_processed_callback
 
std::function< void(Item_processing_data *)> m_item_processed_complete_callback
 
Simple_id_generatorm_object_id_generator
 

Static Private Attributes

static std::atomic< uint64_t > next_id
 Stores next chain element ID to be used. More...
 

Constructor & Destructor Documentation

◆ Abstract_chain_element()

Abstract_chain_element::Abstract_chain_element ( std::function< bool(const Mysql::Tools::Base::Message_data &)> *  message_handler,
Simple_id_generator object_id_generator 
)
protected

Member Function Documentation

◆ generate_new_object_id()

uint64 Abstract_chain_element::generate_new_object_id ( )
protected

◆ get_id()

◆ get_message_handler()

std::function< bool(const Mysql::Tools::Base::Message_data &)> * Abstract_chain_element::get_message_handler ( ) const
protected

◆ get_object_id_generator()

Simple_id_generator * Abstract_chain_element::get_object_id_generator ( ) const
protected

◆ item_completion_in_child_callback()

void Abstract_chain_element::item_completion_in_child_callback ( Item_processing_data item_processed)
overrideprotectedvirtual

This callback can be requested to be called by child for any object processing.

This will be called when the object processing has completed. Note that this function may be called from multiple threads so all implementations must be thread-safe.

Implements Mysql::Tools::Dump::I_chain_element.

Reimplemented in Mysql::Tools::Dump::Abstract_crawler, Mysql::Tools::Dump::Abstract_progress_watcher, Mysql::Tools::Dump::Compression_lz4_writer, Mysql::Tools::Dump::Compression_zlib_writer, Mysql::Tools::Dump::File_writer, Mysql::Tools::Dump::Mysql_crawler, Mysql::Tools::Dump::Mysql_object_reader, Mysql::Tools::Dump::Mysqldump_tool_chain_maker, Mysql::Tools::Dump::Object_queue, Mysql::Tools::Dump::Sql_formatter, and Mysql::Tools::Dump::Standard_writer.

◆ item_completion_in_child_callback_wrapper()

void Abstract_chain_element::item_completion_in_child_callback_wrapper ( Item_processing_data item_processed)
private

Wrapper on item_completion_in_child_callback which allows creation of pointer to function which will then fetch correct virtual method pointer.

◆ item_completion_in_child_completes_task_callback()

void Abstract_chain_element::item_completion_in_child_completes_task_callback ( Item_processing_data item_processed)
private

Wrapper on item_completion_in_child_callback_wrapper which also sets precessed task to be fully completed.

◆ need_callbacks_in_child()

bool Abstract_chain_element::need_callbacks_in_child ( )
protectedvirtual

◆ new_chain_created() [1/2]

Item_processing_data * Abstract_chain_element::new_chain_created ( Chain_data new_chain_data,
Item_processing_data parent_processing_data,
I_chain_element child_chain_element 
)
protected

◆ new_chain_created() [2/2]

Item_processing_data * Abstract_chain_element::new_chain_created ( Item_processing_data current_item_data,
I_dump_task dump_task_created 
)
protected

◆ new_task_created()

Item_processing_data * Abstract_chain_element::new_task_created ( I_dump_task dump_task_created)
protected

◆ object_processing_ends()

void Abstract_chain_element::object_processing_ends ( Item_processing_data processed_item)
protected

◆ object_processing_starts()

void Abstract_chain_element::object_processing_starts ( Item_processing_data item_to_process)
protected

◆ object_to_be_processed_in_child()

Item_processing_data * Abstract_chain_element::object_to_be_processed_in_child ( Item_processing_data current_item_data,
I_chain_element child_chain_element 
)
protected

◆ operator=()

Abstract_chain_element & Mysql::Tools::Dump::Abstract_chain_element::operator= ( Abstract_chain_element &&  other)
delete

Disable move assignment to avoid Wvirtual-move-assign warning.

◆ pass_message()

void Abstract_chain_element::pass_message ( const Mysql::Tools::Base::Message_data message_data)
protected

Passes message to message callback.

◆ register_progress_watcher()

◆ task_to_be_processed_in_child()

Item_processing_data * Abstract_chain_element::task_to_be_processed_in_child ( Item_processing_data current_item_data,
I_chain_element child_chain_element,
I_dump_task task_to_be_processed,
std::function< void(Item_processing_data *)> *  callback 
)
private

◆ try_process_task() [1/2]

template<typename TType , typename TClass >
bool Mysql::Tools::Dump::Abstract_chain_element::try_process_task ( Item_processing_data item_to_process,
void(TClass::*)(TType *)  processing_func 
)
inlineprotected

Process task object with specified function if that task object can be casted to type TType.

Returns true if object was processed.

◆ try_process_task() [2/2]

template<typename TType , typename TClass >
bool Mysql::Tools::Dump::Abstract_chain_element::try_process_task ( Item_processing_data item_to_process,
void(TClass::*)(TType *, Item_processing_data *)  processing_func 
)
inlineprotected

Process task object with specified function if that task object can be casted to type TType.

Returns true if object was processed.

Member Data Documentation

◆ m_id

uint64 Mysql::Tools::Dump::Abstract_chain_element::m_id
private

◆ m_item_processed_callback

std::function<void(Item_processing_data *)> Mysql::Tools::Dump::Abstract_chain_element::m_item_processed_callback
private

◆ m_item_processed_complete_callback

std::function<void(Item_processing_data *)> Mysql::Tools::Dump::Abstract_chain_element::m_item_processed_complete_callback
private

◆ m_message_handler

std::function<bool(const Mysql::Tools::Base::Message_data &)>* Mysql::Tools::Dump::Abstract_chain_element::m_message_handler
private

◆ m_object_id_generator

Simple_id_generator* Mysql::Tools::Dump::Abstract_chain_element::m_object_id_generator
private

◆ next_id

std::atomic< uint64_t > Abstract_chain_element::next_id
staticprivate

Stores next chain element ID to be used.

Used as ID generator.


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