Since it's not mandatory that all fields in a TABLE object are replicated, this class extends Table_columns_view container and adds logic to filter out not needed columns.
More...
|
| 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...
|
|
ReplicatedColumnsView & | set_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 |
|
ReplicatedColumnsView & | operator= (const ReplicatedColumnsView &rhs)=delete |
|
ReplicatedColumnsView & | operator= (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_view & | set_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_view & | set_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_view & | operator= (const Table_columns_view &rhs)=delete |
|
Table_columns_view & | operator= (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 | begin () |
| Creates an iterator object, pointing at the beginning of the table field set. 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_BITMAP & | get_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_BITMAP & | get_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_view & | translate_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) |
|
Since it's not mandatory that all fields in a TABLE object are replicated, this class extends Table_columns_view container and adds logic to filter out not needed columns.
One active use-case relates to hidden generated columns. These type of columns are used to support functional indexes and are not meant to be replicated nor included in the serialization/deserialization of binlog events.
- See also
- ColumnFilterInboundFunctionalIndexes
-
ColumnFilterOutboundFunctionalIndexes
Another case relates to GIPKs, where the source or replica might contain a generated primary key that does not exist on the other side of the stream. In cases of differences in GIPK, the columns should be filtered out
- See also
- ColumnFilterInboundGipk
This class allows for the use of other filters that can be added at any point.