MediaWiki
1.33.0
|
DBMasterPos class for MySQL/MariaDB. More...
Public Member Functions | |
__construct ( $position, $asOfTime) | |
__toString () | |
asOfTime () | |
channelsMatch (DBMasterPos $pos) | |
getGTIDs () | |
getLogFile () | |
getLogName () | |
getLogPosition () | |
hasReached (DBMasterPos $pos) | |
serialize () | |
setActiveDomain ( $id) | |
setActiveOriginServerId ( $id) | |
setActiveOriginServerUUID ( $id) | |
unserialize ( $serialized) | |
Static Public Member Functions | |
static | getCommonDomainGTIDs (MySQLMasterPos $pos, MySQLMasterPos $refPos) |
Public Attributes | |
const | BINARY_LOG = 'binary-log' |
const | GTID_MARIA = 'gtid-maria' |
const | GTID_MYSQL = 'gtid-mysql' |
Protected Member Functions | |
getActiveGtidCoordinates () | |
getBinlogCoordinates () | |
init ( $position, $asOfTime) | |
Static Protected Member Functions | |
static | parseGTID ( $id) |
Private Attributes | |
int null | $activeDomain |
Active GTID domain ID. More... | |
int null | $activeServerId |
ID of the server were DB writes originate. More... | |
string null | $activeServerUUID |
UUID of the server were DB writes originate. More... | |
float | $asOfTime = 0.0 |
UNIX timestamp. More... | |
string null | $binLog |
Base name of all Binary Log files. More... | |
string[] | $gtids = [] |
Map of (server_uuid/gtid_domain_id => GTID) More... | |
int[] null | $logPos |
Binary Log position tuple (index number, event number) More... | |
int | $style |
One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) More... | |
DBMasterPos class for MySQL/MariaDB.
Note that master positions and sync logic here make some assumptions:
Definition at line 19 of file MySQLMasterPos.php.
Wikimedia\Rdbms\MySQLMasterPos::__construct | ( | $position, | |
$asOfTime | |||
) |
string | $position | One of (comma separated GTID list, <binlog file>="">/<integer>) |
float | $asOfTime | UNIX timestamp |
Definition at line 50 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$asOfTime, and Wikimedia\Rdbms\MySQLMasterPos\init().
Wikimedia\Rdbms\MySQLMasterPos::__toString | ( | ) |
Implements Wikimedia\Rdbms\DBMasterPos.
Definition at line 321 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\getLogFile().
Referenced by Wikimedia\Rdbms\MySQLMasterPos\serialize().
Wikimedia\Rdbms\MySQLMasterPos::asOfTime | ( | ) |
Implements Wikimedia\Rdbms\DBMasterPos.
Definition at line 99 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$asOfTime.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init(), and Wikimedia\Rdbms\MySQLMasterPos\serialize().
Wikimedia\Rdbms\MySQLMasterPos::channelsMatch | ( | DBMasterPos | $pos | ) |
DBMasterPos | $pos |
Implements Wikimedia\Rdbms\DBMasterPos.
Definition at line 137 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates(), Wikimedia\Rdbms\MySQLMasterPos\getBinlogCoordinates(), and true.
Referenced by DatabaseMysqlBaseTest\testChannelsMatch(), and DatabaseMysqlBaseTest\testHasReached().
|
protected |
Definition at line 233 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$activeDomain, Wikimedia\Rdbms\MySQLMasterPos\$activeServerId, Wikimedia\Rdbms\MySQLMasterPos\$activeServerUUID, as, list, Wikimedia\Rdbms\MySQLMasterPos\parseGTID(), and style.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\channelsMatch(), Wikimedia\Rdbms\MySQLMasterPos\getCommonDomainGTIDs(), and Wikimedia\Rdbms\MySQLMasterPos\hasReached().
|
protected |
Definition at line 284 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$binLog, and Wikimedia\Rdbms\MySQLMasterPos\$logPos.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\channelsMatch(), and Wikimedia\Rdbms\MySQLMasterPos\hasReached().
|
static |
MySQLMasterPos | $pos | |
MySQLMasterPos | $refPos |
Definition at line 222 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates().
Referenced by Wikimedia\Rdbms\DatabaseMysqlBase\masterPosWait().
Wikimedia\Rdbms\MySQLMasterPos::getGTIDs | ( | ) |
Definition at line 188 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$gtids.
Wikimedia\Rdbms\MySQLMasterPos::getLogFile | ( | ) |
Definition at line 180 of file MySQLMasterPos.php.
References null.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\__toString().
Wikimedia\Rdbms\MySQLMasterPos::getLogName | ( | ) |
Definition at line 164 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$binLog, and null.
Wikimedia\Rdbms\MySQLMasterPos::getLogPosition | ( | ) |
Definition at line 172 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$logPos, and null.
Wikimedia\Rdbms\MySQLMasterPos::hasReached | ( | DBMasterPos | $pos | ) |
DBMasterPos | $pos |
Implements Wikimedia\Rdbms\DBMasterPos.
Definition at line 103 of file MySQLMasterPos.php.
References as, Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\getBinlogCoordinates().
Referenced by DatabaseMysqlBaseTest\testHasReached().
|
protected |
string | $position | |
float | $asOfTime |
Definition at line 58 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$asOfTime, Wikimedia\Rdbms\MySQLMasterPos\$gtids, as, Wikimedia\Rdbms\MySQLMasterPos\asOfTime(), Wikimedia\Rdbms\MySQLMasterPos\BINARY_LOG, Wikimedia\Rdbms\MySQLMasterPos\GTID_MARIA, Wikimedia\Rdbms\MySQLMasterPos\GTID_MYSQL, list, Wikimedia\Rdbms\MySQLMasterPos\parseGTID(), and style.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\__construct(), and Wikimedia\Rdbms\MySQLMasterPos\unserialize().
|
staticprotected |
string | $id | GTID |
Definition at line 263 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\init().
Wikimedia\Rdbms\MySQLMasterPos::serialize | ( | ) |
Definition at line 290 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\__toString(), and Wikimedia\Rdbms\MySQLMasterPos\asOfTime().
Wikimedia\Rdbms\MySQLMasterPos::setActiveDomain | ( | $id | ) |
int | null | $id | @gtid_domain_id of the active replication stream |
Definition at line 196 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::setActiveOriginServerId | ( | $id | ) |
int | null | $id | @server_id of the server were writes originate |
Definition at line 204 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::setActiveOriginServerUUID | ( | $id | ) |
string | null | $id | @server_uuid of the server were writes originate |
Definition at line 212 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::unserialize | ( | $serialized | ) |
|
private |
Active GTID domain ID.
Definition at line 29 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates().
|
private |
ID of the server were DB writes originate.
Definition at line 31 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates().
UUID of the server were DB writes originate.
Definition at line 33 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates().
|
private |
UNIX timestamp.
Definition at line 35 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\__construct(), Wikimedia\Rdbms\MySQLMasterPos\asOfTime(), and Wikimedia\Rdbms\MySQLMasterPos\init().
Base name of all Binary Log files.
Definition at line 23 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getBinlogCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\getLogName().
|
private |
Map of (server_uuid/gtid_domain_id => GTID)
Definition at line 27 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getGTIDs(), and Wikimedia\Rdbms\MySQLMasterPos\init().
|
private |
Binary Log position tuple (index number, event number)
Definition at line 25 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getBinlogCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\getLogPosition().
|
private |
One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA)
Definition at line 21 of file MySQLMasterPos.php.
const Wikimedia\Rdbms\MySQLMasterPos::BINARY_LOG = 'binary-log' |
Definition at line 37 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().
const Wikimedia\Rdbms\MySQLMasterPos::GTID_MARIA = 'gtid-maria' |
Definition at line 38 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().
const Wikimedia\Rdbms\MySQLMasterPos::GTID_MYSQL = 'gtid-mysql' |
Definition at line 39 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().