MySQL 5.6.14 Source Code Document
|
#include <rpl_gtid.h>
Classes | |
class | Gtid_iterator |
struct | Node |
Represents one owned group. |
Public Member Functions | |
Owned_gtids (Checkable_rwlock *sid_lock) | |
~Owned_gtids () | |
Destroys this Owned_gtids. | |
enum_return_status | add_gtid_owner (const Gtid >id, my_thread_id owner) |
my_thread_id | get_owner (const Gtid >id) const |
void | remove_gtid (const Gtid >id) |
enum_return_status | ensure_sidno (rpl_sidno sidno) |
bool | is_intersection_nonempty (const Gtid_set *other) const |
bool | is_empty () const |
Returns true if this Owned_gtids is empty. | |
rpl_sidno | get_max_sidno () const |
Returns the maximal sidno that this Owned_gtids currently has space for. | |
int | to_string (char *out) const |
size_t | get_max_string_length () const |
bool | thread_owns_anything (my_thread_id thd_id) const |
char * | to_string () const |
void | print () const |
Debug only: print this Owned_gtids to stdout. | |
void | dbug_print (const char *text="") const |
Represents the set of GTIDs that are owned by some thread.
This data structure has a read-write lock that protects the number of SIDNOs. The lock is provided by the invoker of the constructor and it is generally the caller's responsibility to acquire the read lock. Access methods assert that the caller already holds the read (or write) lock. If a method of this class grows the number of SIDNOs, then the method temporarily upgrades this lock to a write lock and then degrades it to a read lock again; there will be a short period when the lock is not held at all.
The internal representation is a DYNAMIC_ARRAY that maps SIDNO to HASH, where each HASH maps GNO to my_thread_id.
Definition at line 1747 of file rpl_gtid.h.
Owned_gtids::Owned_gtids | ( | Checkable_rwlock * | sid_lock | ) |
Constructs a new, empty Owned_gtids object.
sid_lock | Read-write lock that protects updates to the number of SIDs. |
Definition at line 24 of file rpl_gtid_owned.cc.
enum_return_status Owned_gtids::add_gtid_owner | ( | const Gtid & | gtid, |
my_thread_id | owner | ||
) |
Add a GTID to this Owned_gtids.
gtid | The Gtid to add. |
owner | The my_thread_id of the group to add. |
Definition at line 82 of file rpl_gtid_owned.cc.
|
inline |
Print this Owned_gtids to the trace file if debug is enabled; no-op otherwise.
Definition at line 1908 of file rpl_gtid.h.
enum_return_status Owned_gtids::ensure_sidno | ( | rpl_sidno | sidno | ) |
Ensures that this Owned_gtids object can accomodate SIDNOs up to the given SIDNO.
If this Owned_gtids object needs to be resized, then the lock will be temporarily upgraded to a write lock and then degraded to a read lock again; there will be a short period when the lock is not held at all.
sidno | The SIDNO. |
Definition at line 55 of file rpl_gtid_owned.cc.
|
inline |
Return an upper bound on the length of the string representation of this Owned_groups. The actual length may be smaller. This includes the trailing '\0'.
Definition at line 1852 of file rpl_gtid.h.
my_thread_id Owned_gtids::get_owner | ( | const Gtid & | gtid | ) | const |
Returns the owner of the given GTID, or 0 if the GTID is not owned.
Definition at line 128 of file rpl_gtid_owned.cc.
bool Owned_gtids::is_intersection_nonempty | ( | const Gtid_set * | other | ) | const |
Returns true if there is a least one element of this Owned_gtids set in the other Gtid_set.
Definition at line 137 of file rpl_gtid_owned.cc.
void Owned_gtids::remove_gtid | ( | const Gtid & | gtid | ) |
Removes the given GTID.
If the group does not exist in this Owned_gtids object, does nothing.
gtid | The Gtid. |
Definition at line 107 of file rpl_gtid_owned.cc.
|
inline |
Return true if the given thread is the owner of any groups.
Definition at line 1870 of file rpl_gtid.h.
|
inline |
Write a string representation of this Owned_groups to the given buffer.
out | Buffer to write to. |
Definition at line 1819 of file rpl_gtid.h.
|
inline |
Debug only: return a newly allocated string representation of this Owned_gtids.
Definition at line 1889 of file rpl_gtid.h.