MediaWiki REL1_35
|
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) | |
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 (MySQLMasterPos $pos, MySQLMasterPos $refPos) |
Protected Member Functions | |
getActiveGtidCoordinates () | |
getBinlogCoordinates () | |
init ( $position, $asOfTime) | |
Static Protected Member Functions | |
static | parseGTID ( $id) |
Private Attributes | |
int null | $activeDomain |
Active GTID domain ID. | |
int 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) | |
int[] 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' |
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 352 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.
|
protected |
Definition at line 264 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$activeDomain, Wikimedia\Rdbms\MySQLMasterPos\$activeServerId, Wikimedia\Rdbms\MySQLMasterPos\$activeServerUUID, and Wikimedia\Rdbms\MySQLMasterPos\parseGTID().
Referenced by Wikimedia\Rdbms\MySQLMasterPos\channelsMatch(), Wikimedia\Rdbms\MySQLMasterPos\getRelevantActiveGTIDs(), and Wikimedia\Rdbms\MySQLMasterPos\hasReached().
|
protected |
Definition at line 315 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().
Wikimedia\Rdbms\MySQLMasterPos::getGTIDs | ( | ) |
Definition at line 189 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$gtids.
Wikimedia\Rdbms\MySQLMasterPos::getLogFile | ( | ) |
Definition at line 180 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\__toString().
Wikimedia\Rdbms\MySQLMasterPos::getLogName | ( | ) |
Definition at line 164 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$binLog.
Wikimedia\Rdbms\MySQLMasterPos::getLogPosition | ( | ) |
Definition at line 172 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$logPos.
|
static |
MySQLMasterPos | $pos | |
MySQLMasterPos | $refPos |
Definition at line 251 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates().
Wikimedia\Rdbms\MySQLMasterPos::hasReached | ( | DBMasterPos | $pos | ) |
DBMasterPos | $pos |
Implements Wikimedia\Rdbms\DBMasterPos.
Definition at line 103 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\getBinlogCoordinates().
|
protected |
string | $position | |
float | $asOfTime |
Definition at line 58 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\$asOfTime, Wikimedia\Rdbms\MySQLMasterPos\$gtids, Wikimedia\Rdbms\MySQLMasterPos\asOfTime(), Wikimedia\Rdbms\MySQLMasterPos\BINARY_LOG, Wikimedia\Rdbms\MySQLMasterPos\GTID_MARIA, Wikimedia\Rdbms\MySQLMasterPos\GTID_MYSQL, and Wikimedia\Rdbms\MySQLMasterPos\parseGTID().
Referenced by Wikimedia\Rdbms\MySQLMasterPos\__construct(), and Wikimedia\Rdbms\MySQLMasterPos\unserialize().
|
staticprotected |
string | $id | GTID |
Definition at line 294 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\getActiveGtidCoordinates(), and Wikimedia\Rdbms\MySQLMasterPos\init().
Wikimedia\Rdbms\MySQLMasterPos::serialize | ( | ) |
Definition at line 321 of file MySQLMasterPos.php.
References Wikimedia\Rdbms\MySQLMasterPos\__toString(), Wikimedia\Rdbms\MySQLMasterPos\asOfTime(), and Wikimedia\Rdbms\MySQLMasterPos\serialize().
Referenced by Wikimedia\Rdbms\MySQLMasterPos\serialize().
Wikimedia\Rdbms\MySQLMasterPos::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
int | null | $id | @gtid_domain_id of the active replication stream |
Definition at line 205 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::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
int | null | $id | @server_id of the server were writes originate |
Definition at line 222 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::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 239 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Wikimedia\Rdbms\MySQLMasterPos::unserialize | ( | $serialized | ) |
Definition at line 331 of file MySQLMasterPos.php.
References $serialized, Wikimedia\Rdbms\MySQLMasterPos\init(), Wikimedia\Rdbms\MySQLMasterPos\setActiveDomain(), Wikimedia\Rdbms\MySQLMasterPos\setActiveOriginServerId(), Wikimedia\Rdbms\MySQLMasterPos\setActiveOriginServerUUID(), and Wikimedia\Rdbms\MySQLMasterPos\unserialize().
Referenced by Wikimedia\Rdbms\MySQLMasterPos\unserialize().
|
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().
|
private |
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().
|
private |
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.
|
private |
Definition at line 37 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().
|
private |
Definition at line 38 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().
|
private |
Definition at line 39 of file MySQLMasterPos.php.
Referenced by Wikimedia\Rdbms\MySQLMasterPos\init().