Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Rdbms\DomainDb Class Reference

Encapsulation of access to MediaWiki DB related functionality that is commonly used in Wikibase. More...

+ Inheritance diagram for Wikibase\Lib\Rdbms\DomainDb:
+ Collaboration diagram for Wikibase\Lib\Rdbms\DomainDb:

Public Member Functions

 __construct (ILBFactory $lbFactory, string $domainId)
 
 sessionConsistentConnections ()
 WARNING: Do not override the load-groups in individual method calls on SessionConsistentConnectionManager.
 
 connections ()
 WARNING: Do not override the load-groups in individual method calls on ConnectionManager! Instead, add them to the factory method!
 
 getAutoCommitPrimaryConnection ()
 
 replication ()
 
 getEmptyTransactionTicket (string $fname)
 Only used in batch writing (replication aware).
 
 commitAndWaitForReplication (string $fname, $ticket)
 Only used in batch writing (replication aware).
 
 autoReconfigure ()
 Reload the LBFactory configuration.
 
 domain ()
 

Private Attributes

ILBFactory $lbFactory
 
string $domainId
 
ReplicationWaiter $replicationWaiter
 
array $loadGroups
 
SessionConsistentConnectionManager $sessionConsistentConnectionManager = null
 
ConnectionManager $connectionManager = null
 

Detailed Description

Encapsulation of access to MediaWiki DB related functionality that is commonly used in Wikibase.

Using this class means in most cases only 1 service need be injected into a service instead of 3+ which would otherwise be needed to have access to the same functionality.

Do not type hint against this abstract class in Wikibase services. Instead, use either ClientDomainDb or RepoDomainDb depending on what kind of wiki is being accessed.

Author
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Rdbms\DomainDb::__construct ( ILBFactory $lbFactory,
string $domainId )

Member Function Documentation

◆ autoReconfigure()

Wikibase\Lib\Rdbms\DomainDb::autoReconfigure ( )

Reload the LBFactory configuration.

Long-running processes should call this regularly.

See also
ILBFactory::autoReconfigure

◆ commitAndWaitForReplication()

Wikibase\Lib\Rdbms\DomainDb::commitAndWaitForReplication ( string $fname,
$ticket )

Only used in batch writing (replication aware).

See https://www.mediawiki.org/wiki/Database_transactions#Splitting_writes_into_multiple_transactions

Parameters
string$fnameCaller name (e.g. METHOD)
mixed$ticketResult of getEmptyTransactionTicket()
Returns
bool True if the wait was successful, false on timeout

◆ connections()

Wikibase\Lib\Rdbms\DomainDb::connections ( )

WARNING: Do not override the load-groups in individual method calls on ConnectionManager! Instead, add them to the factory method!

◆ domain()

Wikibase\Lib\Rdbms\DomainDb::domain ( )
Deprecated
Don't use this unless it needs to be passed to a service we don't control

◆ getAutoCommitPrimaryConnection()

Wikibase\Lib\Rdbms\DomainDb::getAutoCommitPrimaryConnection ( )

◆ getEmptyTransactionTicket()

Wikibase\Lib\Rdbms\DomainDb::getEmptyTransactionTicket ( string $fname)

Only used in batch writing (replication aware).

See https://www.mediawiki.org/wiki/Database_transactions#Splitting_writes_into_multiple_transactions

Parameters
string$fnameCaller name (e.g. METHOD)
Returns
mixed A value to pass to commitAndWaitForReplication()

◆ replication()

Wikibase\Lib\Rdbms\DomainDb::replication ( )

◆ sessionConsistentConnections()

Wikibase\Lib\Rdbms\DomainDb::sessionConsistentConnections ( )

WARNING: Do not override the load-groups in individual method calls on SessionConsistentConnectionManager.

Instead add them to the factory method!

Member Data Documentation

◆ $connectionManager

ConnectionManager Wikibase\Lib\Rdbms\DomainDb::$connectionManager = null
private

◆ $domainId

string Wikibase\Lib\Rdbms\DomainDb::$domainId
private

◆ $lbFactory

ILBFactory Wikibase\Lib\Rdbms\DomainDb::$lbFactory
private

◆ $loadGroups

array Wikibase\Lib\Rdbms\DomainDb::$loadGroups
private

◆ $replicationWaiter

ReplicationWaiter Wikibase\Lib\Rdbms\DomainDb::$replicationWaiter
private

◆ $sessionConsistentConnectionManager

SessionConsistentConnectionManager Wikibase\Lib\Rdbms\DomainDb::$sessionConsistentConnectionManager = null
private

The documentation for this class was generated from the following file: