MySQL 8.0.40
Source Code Documentation
Gtid_set_ref Class Reference

This class extends Gtid_set to include a reference counter. More...

#include <certifier.h>

Inheritance diagram for Gtid_set_ref:
[legend]

Public Member Functions

 Gtid_set_ref (Sid_map *sid_map, int64 parallel_applier_sequence_number)
 
virtual ~Gtid_set_ref ()=default
 
size_t link ()
 Increment the number of references by one. More...
 
size_t unlink ()
 Decrement the number of references by one. More...
 
int64 get_parallel_applier_sequence_number () const
 
- Public Member Functions inherited from Gtid_set
 Gtid_set (Sid_map *sid_map, Checkable_rwlock *sid_lock=nullptr)
 Constructs a new, empty Gtid_set. More...
 
 Gtid_set (Sid_map *sid_map, const char *text, enum_return_status *status, Checkable_rwlock *sid_lock=nullptr)
 Constructs a new Gtid_set that contains the gtids in the given string, in the same format as add_gtid_text(char *). More...
 
 ~Gtid_set ()
 Destroy this Gtid_set. More...
 
void claim_memory_ownership (bool claim)
 Claim ownership of memory. More...
 
void clear ()
 Removes all gtids from this Gtid_set. More...
 
void clear_set_and_sid_map ()
 Removes all gtids from this Gtid_set and clear all the sidnos used by the Gtid_set and it's SID map. More...
 
void _add_gtid (rpl_sidno sidno, rpl_gno gno)
 Adds the given GTID to this Gtid_set. More...
 
void _remove_gtid (rpl_sidno sidno, rpl_gno gno)
 Removes the given GTID from this Gtid_set. More...
 
void _add_gtid (const Gtid &gtid)
 Adds the given GTID to this Gtid_set. More...
 
void _remove_gtid (const Gtid &gtid)
 Removes the given GTID from this Gtid_set. More...
 
enum_return_status add_gtid_set (const Gtid_set *other)
 Adds all gtids from the given Gtid_set to this Gtid_set. More...
 
void remove_gtid_set (const Gtid_set *other)
 Removes all gtids in the given Gtid_set from this Gtid_set. More...
 
void remove_intervals_for_sidno (Gtid_set *other, rpl_sidno sidno)
 Removes all intervals of 'other' for a given SIDNO, from 'this'. More...
 
enum_return_status add_gtid_text (const char *text, bool *anonymous=nullptr, bool *starts_with_plus=nullptr)
 Adds the set of GTIDs represented by the given string to this Gtid_set. More...
 
enum_return_status add_gtid_encoding (const uchar *encoded, size_t length, size_t *actual_length=nullptr)
 Decodes a Gtid_set from the given string. More...
 
bool contains_gtid (rpl_sidno sidno, rpl_gno gno) const
 Return true iff the given GTID exists in this set. More...
 
bool contains_gtid (const Gtid &gtid) const
 Return true iff the given GTID exists in this set. More...
 
rpl_gno get_last_gno (rpl_sidno sidno) const
 
rpl_sidno get_max_sidno () const
 Returns the maximal sidno that this Gtid_set currently has space for. More...
 
enum_return_status ensure_sidno (rpl_sidno sidno)
 Allocates space for all sidnos up to the given sidno in the array of intervals. More...
 
bool is_subset (const Gtid_set *super) const
 Returns true if this Gtid_set is a subset of the other Gtid_set. More...
 
bool is_subset_not_equals (const Gtid_set *super) const
 Returns true if this Gtid_set is a non equal subset of the other Gtid_set. More...
 
bool is_subset_for_sid (const Gtid_set *super, rpl_sidno superset_sidno, rpl_sidno subset_sidno) const
 Returns true if this Gtid_set is a subset of the given gtid_set on the given superset_sidno and subset_sidno. More...
 
bool is_intersection_nonempty (const Gtid_set *other) const
 Returns true if there is a least one element of this Gtid_set in the other Gtid_set. More...
 
enum_return_status intersection (const Gtid_set *other, Gtid_set *result)
 Add the intersection of this Gtid_set and the other Gtid_set to result. More...
 
bool is_empty () const
 Returns true if this Gtid_set is empty. More...
 
bool is_size_greater_than_or_equal (ulonglong num) const
 Return true if the size of the set is greater than or equal to the given number. More...
 
ulonglong get_gtid_count (rpl_sidno sidno) const
 What is the count of all the GTIDs in all intervals for a sidno. More...
 
bool contains_sidno (rpl_sidno sidno) const
 Returns true if this Gtid_set contains at least one GTID with the given SIDNO. More...
 
size_t get_string_length (const String_format *string_format=nullptr) const
 Returns the length of the output from to_string. More...
 
size_t to_string (char *buf, bool need_lock=false, const String_format *string_format=nullptr) const
 Formats this Gtid_set as a string and saves in a given buffer. More...
 
long to_string (char **buf, bool need_lock=false, const String_format *string_format=nullptr) const
 Formats a Gtid_set as a string and saves in a newly allocated buffer. More...
 
void print (bool need_lock=false, const Gtid_set::String_format *sf=nullptr) const
 Debug only: Print this Gtid_set to stdout. More...
 
void dbug_print (const char *text="", bool need_lock=false, const Gtid_set::String_format *sf=nullptr) const
 Print this Gtid_set to the trace file if debug is enabled; no-op otherwise. More...
 
void get_gtid_intervals (std::list< Gtid_interval > *gtid_intervals) const
 Gets all gtid intervals from this Gtid_set. More...
 
Sid_mapget_sid_map () const
 Return the Sid_map associated with this Gtid_set. More...
 
void add_interval_memory (int n_intervals, Interval *intervals_param)
 Provides an array of Intervals that this Gtid_set can use when gtids are subsequently added. More...
 
void encode (uchar *buf) const
 Encodes this Gtid_set as a binary string. More...
 
size_t get_encoded_length () const
 Returns the length of this Gtid_set when encoded using the encode() function. More...
 

Private Attributes

size_t reference_counter
 
int64 parallel_applier_sequence_number
 

Additional Inherited Members

- Static Public Member Functions inherited from Gtid_set
static bool is_valid (const char *text)
 Returns true if the given string is a valid specification of a Gtid_set, false otherwise. More...
 
- Static Public Attributes inherited from Gtid_set
static PSI_mutex_key key_gtid_executed_free_intervals_mutex
 
static const String_format default_string_format
 The default String_format: the format understood by add_gtid_text(const char *). More...
 
static const String_format sql_string_format
 String_format useful to generate an SQL string: the string is wrapped in single quotes and there is a newline between SIDs. More...
 
static const String_format commented_string_format
 String_format for printing the Gtid_set commented: the string is not quote-wrapped, and every SID is on a new line with a leading '# '. More...
 

Detailed Description

This class extends Gtid_set to include a reference counter.

It is for Certifier only, so it is single-threaded and no locks are needed since Certifier already ensures sequential use.

It is to be used to share by multiple entries in the certification info and released when the last reference to it needs to be freed.

Constructor & Destructor Documentation

◆ Gtid_set_ref()

Gtid_set_ref::Gtid_set_ref ( Sid_map sid_map,
int64  parallel_applier_sequence_number 
)
inline

◆ ~Gtid_set_ref()

virtual Gtid_set_ref::~Gtid_set_ref ( )
virtualdefault

Member Function Documentation

◆ get_parallel_applier_sequence_number()

int64 Gtid_set_ref::get_parallel_applier_sequence_number ( ) const
inline

◆ link()

size_t Gtid_set_ref::link ( )
inline

Increment the number of references by one.

Returns
the number of references

◆ unlink()

size_t Gtid_set_ref::unlink ( )
inline

Decrement the number of references by one.

Returns
the number of references

Member Data Documentation

◆ parallel_applier_sequence_number

int64 Gtid_set_ref::parallel_applier_sequence_number
private

◆ reference_counter

size_t Gtid_set_ref::reference_counter
private

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