MySQL 8.4.0
Source Code Documentation
cs::util::ReplicatedColumnsViewWithGipkOnSource Class Reference

Class used when we want a column view over a table in a context where the replicated table contains a GIPK on the source, but not on the replica. More...

#include <replicated_columns_view_with_gipk_on_source.h>

Inheritance diagram for cs::util::ReplicatedColumnsViewWithGipkOnSource:
[legend]

Public Member Functions

 ReplicatedColumnsViewWithGipkOnSource (TABLE const *table, THD const *thd=nullptr)
 Constructor which takes the TABLE object whose field set will be iterated. More...
 
virtual ~ReplicatedColumnsViewWithGipkOnSource () override=default
 Destructor for the class. More...
 
Table_columns_view ::iterator begin () override
 This method overrides Table_columns_view::begin Its start value insure that filtered positions are incremented by 1 when compared to the base iterator. More...
 
 ReplicatedColumnsViewWithGipkOnSource (const ReplicatedColumnsViewWithGipkOnSource &rhs)=delete
 
 ReplicatedColumnsViewWithGipkOnSource (ReplicatedColumnsViewWithGipkOnSource &&rhs)=delete
 
ReplicatedColumnsViewWithGipkOnSourceoperator= (const ReplicatedColumnsViewWithGipkOnSource &rhs)=delete
 
ReplicatedColumnsViewWithGipkOnSourceoperator= (ReplicatedColumnsViewWithGipkOnSource &&rhs)=delete
 
- Public Member Functions inherited from cs::util::ReplicatedColumnsView
 ReplicatedColumnsView (THD const *thd=nullptr)
 Constructor for table iteration where a table and filters can be configured. More...
 
 ReplicatedColumnsView (TABLE const *table, THD const *thd=nullptr)
 Constructor which takes the TABLE object whose field set will be iterated. More...
 
 ~ReplicatedColumnsView () override=default
 Destructor for the class. More...
 
ReplicatedColumnsViewset_thd (THD const *thd)
 Setter to initialize the THD object instance to be used to determine if filtering is enabled. More...
 
virtual bool execute_filtering (TABLE const *table, size_t column_index)
 Returns whether or not the field of table table at column_index is to be filtered from this container iteration, according to the list of filters. More...
 
void add_filter (cs::util::ColumnFilterFactory::ColumnFilterType filter_type)
 Adds a new filter according to the given type. More...
 
void add_filter_if_needed (THD const &thd, TABLE *table, table_def const *tabledef, cs::util::ColumnFilterFactory::ColumnFilterType filter_type)
 adds a new filter if the filter's static member function is_filter_needed returns true More...
 
 ReplicatedColumnsView (const ReplicatedColumnsView &rhs)=delete
 
 ReplicatedColumnsView (ReplicatedColumnsView &&rhs)=delete
 
ReplicatedColumnsViewoperator= (const ReplicatedColumnsView &rhs)=delete
 
ReplicatedColumnsViewoperator= (ReplicatedColumnsView &&rhs)=delete
 
- Public Member Functions inherited from Table_columns_view< ExclusionFilter >
template<typename U = ExclusionFilter>
 Table_columns_view (unsigned long options=0, typename std::enable_if< std::is_same< U, std::function< bool(TABLE const *, size_t)> >::value >::type *=nullptr)
 Empty constructor, only available when the predicate type is a lambda function. More...
 
template<typename U = ExclusionFilter>
 Table_columns_view (TABLE const *table, unsigned long options=0, typename std::enable_if< std::is_same< U, std::function< bool(TABLE const *, size_t)> >::value >::type *=nullptr)
 Constructor that takes the target TABLE object, only available when the predicate type is a lambda function. More...
 
 Table_columns_view (ExclusionFilter filtering_predicate, unsigned long options=0)
 Constructor which takes a predicate used to filter this container iteration. More...
 
 Table_columns_view (TABLE const *table, ExclusionFilter filtering_predicate, unsigned long options=0)
 Constructor which takes the TABLE object whose field set will be iterated and a predicate used to filter this container iteration. More...
 
virtual ~Table_columns_view ()
 Destructor for the class. More...
 
virtual Table_columns_viewset_table (const TABLE *rhs)
 Setter which initializes the internal reference to the TABLE object whose field set will be iterated over. More...
 
virtual Table_columns_viewset_filter (ExclusionFilter rhs)
 Setter which initializes the internal filtering predicate of type ExclusionFilter. More...
 
 Table_columns_view (const Table_columns_view &rhs)=delete
 
 Table_columns_view (Table_columns_view &&rhs)=delete
 
Table_columns_viewoperator= (const Table_columns_view &rhs)=delete
 
Table_columns_viewoperator= (Table_columns_view &&rhs)=delete
 
size_t absolute_size () const
 Computes the total number of fields in the table. More...
 
size_t filtered_size () const
 Computes the total number of fields after filtering. More...
 
virtual iterator end ()
 Creates an iterator object, pointing at the end of the table field set. More...
 
bool is_excluded (size_t index) const
 Returns whether or not the field at index is to be excluded from the field set iteration process. More...
 
MY_BITMAPget_included_fields_bitmap ()
 Returns the bitmap for the columns from the local table set that are to be included in the replicated row. More...
 
MY_BITMAPget_excluded_fields_bitmap ()
 Returns the bitmap for the columns from the local table set that are to be excluded from the replicated row. More...
 
Table_columns_viewtranslate_bitmap (MY_BITMAP &source, MY_BITMAP &destination)
 Takes a bitmap object, as received from the replication channel and translates it to a bitmap that matches the local TABLE object. More...
 
size_t translate_position (size_t source)
 For the absolute position on the table that equals the given position given as a parameter, return the translated position. More...
 
iterator find_by_absolute_pos (size_t absolute_pos)
 Returns the iterator for the (absolute) position in the table. More...
 
template<typename F >
 Table_columns_view (F filtering_predicate, unsigned long options)
 
template<typename F >
 Table_columns_view (TABLE const *target, F filtering_predicate, unsigned long options)
 

Additional Inherited Members

- Public Types inherited from Table_columns_view< ExclusionFilter >
using filter_fn_type = ExclusionFilter
 Alias for the predicate type, for readability purposes. More...
 
- Static Public Attributes inherited from Table_columns_view< ExclusionFilter >
static constexpr unsigned long DEFAULTS = 0
 Default set of options. More...
 
static constexpr unsigned long VFIELDS_ONLY = 1
 Request the view excluding filter to operate TABLE::vfields instead of the full set. More...
 
- Protected Member Functions inherited from Table_columns_view< ExclusionFilter >
Table_columns_viewinit_fields_bitmaps ()
 Initializes the internal included and excluded fields bitmaps. More...
 

Detailed Description

Class used when we want a column view over a table in a context where the replicated table contains a GIPK on the source, but not on the replica.

SOURCE TABLE t +---—+-—+-—+-—+ | GIPK | C1 | C2 | C3 | +---—+-—+-—+-—+

REPLICA TABLE t +-—+-—+-—+ | C1 | C2 | C3 | +-—+-—+-—+

This class differs from a standard column view:

  • begin() will cause that returned filtered position, that pertain to the source, are always incremented by 1. This way, C1 on the replica matches C1 on the source data

Constructor & Destructor Documentation

◆ ReplicatedColumnsViewWithGipkOnSource() [1/3]

cs::util::ReplicatedColumnsViewWithGipkOnSource::ReplicatedColumnsViewWithGipkOnSource ( TABLE const *  table,
THD const *  thd = nullptr 
)

Constructor which takes the TABLE object whose field set will be iterated.

Parameters
tablereference to the target TABLE object.
thdinstance of THD class to be used to determine if filtering is to be enabled. It may be nullptr.

◆ ~ReplicatedColumnsViewWithGipkOnSource()

virtual cs::util::ReplicatedColumnsViewWithGipkOnSource::~ReplicatedColumnsViewWithGipkOnSource ( )
overridevirtualdefault

Destructor for the class.

◆ ReplicatedColumnsViewWithGipkOnSource() [2/3]

cs::util::ReplicatedColumnsViewWithGipkOnSource::ReplicatedColumnsViewWithGipkOnSource ( const ReplicatedColumnsViewWithGipkOnSource rhs)
delete

◆ ReplicatedColumnsViewWithGipkOnSource() [3/3]

cs::util::ReplicatedColumnsViewWithGipkOnSource::ReplicatedColumnsViewWithGipkOnSource ( ReplicatedColumnsViewWithGipkOnSource &&  rhs)
delete

Member Function Documentation

◆ begin()

Table_columns_view::iterator cs::util::ReplicatedColumnsViewWithGipkOnSource::begin ( void  )
overridevirtual

This method overrides Table_columns_view::begin Its start value insure that filtered positions are incremented by 1 when compared to the base iterator.

Returns
a column view iterator over the table

Reimplemented from Table_columns_view< ExclusionFilter >.

◆ operator=() [1/2]

ReplicatedColumnsViewWithGipkOnSource & cs::util::ReplicatedColumnsViewWithGipkOnSource::operator= ( const ReplicatedColumnsViewWithGipkOnSource rhs)
delete

◆ operator=() [2/2]

ReplicatedColumnsViewWithGipkOnSource & cs::util::ReplicatedColumnsViewWithGipkOnSource::operator= ( ReplicatedColumnsViewWithGipkOnSource &&  rhs)
delete

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