MySQL 8.0.39
Source Code Documentation
|
This class represents a range of transaction identifiers. More...
#include <gtidset.h>
Public Member Functions | |
virtual | ~Gno_interval ()=default |
Gno_interval & | operator= (const Gno_interval &other) |
Copy assignment. More... | |
Gno_interval (const Gno_interval &other) | |
Construct a new Gno_interval object from the other one provided. More... | |
virtual bool | operator== (const Gno_interval &other) const |
Compares this interval with another one. More... | |
Gno_interval (gno_t start, gno_t end) | |
Construct a new Gno_interval object. More... | |
virtual bool | operator< (const Gno_interval &other) const |
Establishes a total order between two intervals. More... | |
virtual bool | intersects (const Gno_interval &other) const |
This checks whether this interval intersects with the other. More... | |
virtual bool | contiguous (const Gno_interval &other) const |
Checks if this interval is contiguous with the other one. More... | |
virtual bool | intersects_or_contiguous (const Gno_interval &other) const |
Checks if the other interval intersects or is contiguous with this one. More... | |
virtual bool | add (const Gno_interval &other) |
Adds the other interval to this one. More... | |
virtual gno_t | get_start () const |
Gets the first sequence number in the interval. More... | |
virtual gno_t | get_end () const |
Gets the last sequence number in the interval. More... | |
virtual std::size_t | count () const |
Number of entries in this interval. More... | |
virtual std::string | to_string () const |
Gets a human readable representation of this identifier. More... | |
virtual bool | is_valid () const |
Checks whether this interval is valid or not. More... | |
Static Public Attributes | |
static const std::string | SEPARATOR_GNO_START_END {"-"} |
In 'UUID:GNO-GNO', this is the '-'. More... | |
Private Attributes | |
gno_t | m_start {0} |
gno_t | m_next_gno_after_end {0} |
This class represents a range of transaction identifiers.
A transaction identifier is composed of two parts, the UUID and the sequence number.
There can be multiple transaction identifiers for a given UUID. When their sequence number are contiguous they can be represented as an interval. This is the class that represents on of those intervals.
|
virtualdefault |
binary_log::gtids::Gno_interval::Gno_interval | ( | const Gno_interval & | other | ) |
Construct a new Gno_interval object from the other one provided.
other | The object to copy. |
Construct a new Gno_interval object.
start | The start of the interval (inclusive). |
end | The end of the interval (inclusive). |
|
virtual |
Adds the other interval to this one.
For this operation to complete successfully, the intervals must intersect or be contiguous. Otherwise, the operation will fail.
other | The interval to add to this one. |
|
virtual |
Checks if this interval is contiguous with the other one.
Two intervals are contiguous if they do not intersect but there are no gaps between them. No gaps means that the upper limit of interval A is the value immediately preceding the lower limit of interval B, under numeric natural ordering.
other | the interval to check against. |
|
virtual |
Number of entries in this interval.
|
virtual |
Gets the last sequence number in the interval.
|
virtual |
Gets the first sequence number in the interval.
|
virtual |
This checks whether this interval intersects with the other.
other | The other interval to check against this one. |
|
virtual |
Checks if the other interval intersects or is contiguous with this one.
other | The interval to check against this one. |
|
virtual |
Checks whether this interval is valid or not.
An interval is invalid if the start value is smaller than 0 or if the start is larger than the end of the interval.
|
virtual |
Establishes a total order between two intervals.
Total order is determined using the start and end values of the interval.
An interval A comes before interval B if its start value is smaller than the start value of B.
If B's start value is smaller than A's start value then B comes before A.
If A and B have the same start value, the the end of the intervals are checked and if A has a lower interval end than B, then A is considered to come before B in that case.
other | the other interval. |
Gno_interval & binary_log::gtids::Gno_interval::operator= | ( | const Gno_interval & | other | ) |
Copy assignment.
other | The other interval to copy. |
|
virtual |
Compares this interval with another one.
Returns true if there is a match.
other | The other interval to compare this one with. |
|
virtual |
Gets a human readable representation of this identifier.
|
private |
|
private |
|
inlinestatic |
In 'UUID:GNO-GNO', this is the '-'.