MediaWiki REL1_40
|
Narrow interface providing primary/replica connections. More...
Inherited by Wikimedia\Rdbms\ILBFactory.
Public Member Functions | |
commitAndWaitForReplication ( $fname, $ticket, array $opts=[]) | |
Commit primary DB transactions and wait for replication (if $ticket indicates it is safe). | |
getEmptyTransactionTicket ( $fname) | |
Get a token asserting that no write transactions are active on tracked connections. | |
getPrimaryDatabase ( $domain=false) | |
Get connection to the primary database. | |
getReplicaDatabase ( $domain=false, $group=null) | |
Get connection to a replica database. | |
Narrow interface providing primary/replica connections.
This will be heavily used outside the rdmbs library and will become the main interface. No methods should be added unless absolutely needed.
Definition at line 33 of file IConnectionProvider.php.
Wikimedia\Rdbms\IConnectionProvider::commitAndWaitForReplication | ( | $fname, | |
$ticket, | |||
array | $opts = [] ) |
Commit primary DB transactions and wait for replication (if $ticket indicates it is safe).
This is mostly used in jobs or deferred updates dealing with batching.
The ticket is used to check that the caller owns the transaction round or can act on behalf of the caller that owns the transaction round.
string | $fname | Caller name (e.g. METHOD) |
mixed | $ticket | Result of getEmptyTransactionTicket() |
array | $opts | Options to waitForReplication() |
Implemented in Wikimedia\Rdbms\LBFactory.
Wikimedia\Rdbms\IConnectionProvider::getEmptyTransactionTicket | ( | $fname | ) |
Get a token asserting that no write transactions are active on tracked connections.
This is mostly used in jobs or deferred updates dealing with batching.
string | $fname | Caller name (e.g. METHOD) |
Implemented in Wikimedia\Rdbms\LBFactory.
Referenced by DeferredUpdates\attemptUpdate().
Wikimedia\Rdbms\IConnectionProvider::getPrimaryDatabase | ( | $domain = false | ) |
Get connection to the primary database.
This should be used when there the code needs to write to the database.
string | false | $domain | Domain ID, or false for the current domain |
Implemented in Wikimedia\Rdbms\LBFactory.
Wikimedia\Rdbms\IConnectionProvider::getReplicaDatabase | ( | $domain = false, | |
$group = null ) |
Get connection to a replica database.
Note that a read can have replication lag.
string | false | $domain | Domain ID, or false for the current domain |
string | null | $group | Query group; null for the default group |
Implemented in Wikimedia\Rdbms\LBFactory.