MediaWiki REL1_37
|
DBPrimaryPos class for MySQL/MariaDB. More...
Public Member Functions | |
__construct ( $position, $asOfTime) | |
__serialize () | |
__toString () | |
__unserialize ( $data) | |
asOfTime () | |
channelsMatch (DBPrimaryPos $pos) | |
getGTIDs () | |
getLogFile () | |
getLogName () | |
getLogPosition () | |
hasReached (DBPrimaryPos $pos) | |
serialize () | |
setActiveDomain ( $id) | |
Set the GTID domain known to be used in new commits on a replication stream of interest. | |
setActiveOriginServerId ( $id) | |
Set the server ID known to be used in new commits on a replication stream of interest. | |
setActiveOriginServerUUID ( $id) | |
Set the server UUID known to be used in new commits on a replication stream of interest. | |
unserialize ( $serialized) | |
Static Public Member Functions | |
static | getRelevantActiveGTIDs (MySQLPrimaryPos $pos, MySQLPrimaryPos $refPos) |
Protected Member Functions | |
getActiveGtidCoordinates () | |
getBinlogCoordinates () | |
init ( $position, $asOfTime) | |
Static Protected Member Functions | |
static | parseGTID ( $id) |
Private Attributes | |
string null | $activeDomain |
Active GTID domain ID. | |
string null | $activeServerId |
ID of the server were DB writes originate. | |
string null | $activeServerUUID |
UUID of the server were DB writes originate. | |
float | $asOfTime = 0.0 |
UNIX timestamp. | |
string null | $binLog |
Base name of all Binary Log files. | |
string[] | $gtids = [] |
Map of (server_uuid/gtid_domain_id => GTID) | |
array< int, int|string > null | $logPos |
Binary Log position tuple (index number, event number) | |
string | $style |
One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) | |
const | BINARY_LOG = 'binary-log' |
const | GTID_MARIA = 'gtid-maria' |
const | GTID_MYSQL = 'gtid-mysql' |
DBPrimaryPos class for MySQL/MariaDB.
Note that primary positions and sync logic here make some assumptions:
Definition at line 20 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::__construct | ( | $position, | |
$asOfTime | |||
) |
string | $position | One of (comma separated GTID list, <binlog file>/<64 bit integer>) |
float | $asOfTime | UNIX timestamp |
Definition at line 51 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$asOfTime, and Wikimedia\Rdbms\MySQLPrimaryPos\init().
Wikimedia\Rdbms\MySQLPrimaryPos::__serialize | ( | ) |
Definition at line 333 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::__toString | ( | ) |
Implements Wikimedia\Rdbms\DBPrimaryPos.
Definition at line 367 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::__unserialize | ( | $data | ) |
Definition at line 347 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::asOfTime | ( | ) |
Implements Wikimedia\Rdbms\DBPrimaryPos.
Definition at line 100 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$asOfTime.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\init().
Wikimedia\Rdbms\MySQLPrimaryPos::channelsMatch | ( | DBPrimaryPos | $pos | ) |
DBPrimaryPos | $pos |
Implements Wikimedia\Rdbms\DBPrimaryPos.
Definition at line 138 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates(), Wikimedia\Rdbms\MySQLPrimaryPos\getBinlogCoordinates(), and true.
|
protected |
Definition at line 265 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$activeDomain, Wikimedia\Rdbms\MySQLPrimaryPos\$activeServerId, Wikimedia\Rdbms\MySQLPrimaryPos\$activeServerUUID, and Wikimedia\Rdbms\MySQLPrimaryPos\parseGTID().
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\channelsMatch(), Wikimedia\Rdbms\MySQLPrimaryPos\getRelevantActiveGTIDs(), and Wikimedia\Rdbms\MySQLPrimaryPos\hasReached().
|
protected |
Definition at line 323 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$binLog, and Wikimedia\Rdbms\MySQLPrimaryPos\$logPos.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\channelsMatch(), and Wikimedia\Rdbms\MySQLPrimaryPos\hasReached().
Wikimedia\Rdbms\MySQLPrimaryPos::getGTIDs | ( | ) |
Definition at line 190 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$gtids.
Wikimedia\Rdbms\MySQLPrimaryPos::getLogFile | ( | ) |
Definition at line 181 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::getLogName | ( | ) |
Definition at line 165 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$binLog.
Wikimedia\Rdbms\MySQLPrimaryPos::getLogPosition | ( | ) |
Definition at line 173 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$logPos.
|
static |
MySQLPrimaryPos | $pos | |
MySQLPrimaryPos | $refPos |
Definition at line 252 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates().
Wikimedia\Rdbms\MySQLPrimaryPos::hasReached | ( | DBPrimaryPos | $pos | ) |
DBPrimaryPos | $pos |
Implements Wikimedia\Rdbms\DBPrimaryPos.
Definition at line 104 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLPrimaryPos\getBinlogCoordinates().
|
protected |
string | $position | |
float | $asOfTime |
Definition at line 59 of file MySQLPrimaryPos.php.
References Wikimedia\Rdbms\MySQLPrimaryPos\$asOfTime, Wikimedia\Rdbms\MySQLPrimaryPos\$gtids, Wikimedia\Rdbms\MySQLPrimaryPos\asOfTime(), Wikimedia\Rdbms\MySQLPrimaryPos\BINARY_LOG, Wikimedia\Rdbms\MySQLPrimaryPos\GTID_MARIA, Wikimedia\Rdbms\MySQLPrimaryPos\GTID_MYSQL, and Wikimedia\Rdbms\MySQLPrimaryPos\parseGTID().
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\__construct().
|
staticprotected |
string | $id | GTID |
Definition at line 296 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLPrimaryPos\init().
Wikimedia\Rdbms\MySQLPrimaryPos::serialize | ( | ) |
Definition at line 329 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::setActiveDomain | ( | $id | ) |
Set the GTID domain known to be used in new commits on a replication stream of interest.
This makes getRelevantActiveGTIDs() filter out GTIDs from other domains
string | int | null | $id | @gtid_domain_id of the active replication stream |
Definition at line 206 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::setActiveOriginServerId | ( | $id | ) |
Set the server ID known to be used in new commits on a replication stream of interest.
This makes getRelevantActiveGTIDs() filter out GTIDs from other origin servers
string | int | null | $id | @server_id of the server were writes originate |
Definition at line 223 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::setActiveOriginServerUUID | ( | $id | ) |
Set the server UUID known to be used in new commits on a replication stream of interest.
This makes getRelevantActiveGTIDs() filter out GTIDs from other origin servers
string | null | $id | @server_uuid of the server were writes originate |
Definition at line 240 of file MySQLPrimaryPos.php.
Wikimedia\Rdbms\MySQLPrimaryPos::unserialize | ( | $serialized | ) |
Definition at line 343 of file MySQLPrimaryPos.php.
|
private |
Active GTID domain ID.
Definition at line 30 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates().
|
private |
ID of the server were DB writes originate.
Definition at line 32 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates().
|
private |
UUID of the server were DB writes originate.
Definition at line 34 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getActiveGtidCoordinates().
|
private |
UNIX timestamp.
Definition at line 36 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\__construct(), Wikimedia\Rdbms\MySQLPrimaryPos\asOfTime(), and Wikimedia\Rdbms\MySQLPrimaryPos\init().
|
private |
Base name of all Binary Log files.
Definition at line 24 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getBinlogCoordinates(), and Wikimedia\Rdbms\MySQLPrimaryPos\getLogName().
|
private |
Map of (server_uuid/gtid_domain_id => GTID)
Definition at line 28 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getGTIDs(), and Wikimedia\Rdbms\MySQLPrimaryPos\init().
|
private |
Binary Log position tuple (index number, event number)
Definition at line 26 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\getBinlogCoordinates(), and Wikimedia\Rdbms\MySQLPrimaryPos\getLogPosition().
|
private |
One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA)
Definition at line 22 of file MySQLPrimaryPos.php.
|
private |
Definition at line 38 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\init().
|
private |
Definition at line 39 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\init().
|
private |
Definition at line 40 of file MySQLPrimaryPos.php.
Referenced by Wikimedia\Rdbms\MySQLPrimaryPos\init().