MediaWiki REL1_41
|
MediaWiki-specific class for generating database load balancers. More...
Public Member Functions | |
__construct (ServiceOptions $options, ConfiguredReadOnlyMode $readOnlyMode, ChronologyProtector $chronologyProtector, BagOStuff $srvCache, WANObjectCache $wanCache, CriticalSectionProvider $csProvider, StatsdDataFactoryInterface $statsdDataFactory, array $virtualDomains) | |
applyDefaultConfig (array $lbConf) | |
applyGlobalState (ILBFactory $lbFactory, Config $config, IBufferingStatsdDataFactory $stats) | |
Apply global state from the current web request or other PHP process. | |
getLBFactoryClass (array $config) | |
Decide which LBFactory class to use. | |
setDomainAliases (ILBFactory $lbFactory) | |
Static Public Member Functions | |
static | logDeprecation ( $msg) |
Log a database deprecation warning. | |
Public Attributes | |
const | APPLY_DEFAULT_CONFIG_OPTIONS |
MediaWiki-specific class for generating database load balancers.
Definition at line 42 of file MWLBFactory.php.
MWLBFactory::__construct | ( | ServiceOptions | $options, |
ConfiguredReadOnlyMode | $readOnlyMode, | ||
ChronologyProtector | $chronologyProtector, | ||
BagOStuff | $srvCache, | ||
WANObjectCache | $wanCache, | ||
CriticalSectionProvider | $csProvider, | ||
StatsdDataFactoryInterface | $statsdDataFactory, | ||
array | $virtualDomains ) |
ServiceOptions | $options | |
ConfiguredReadOnlyMode | $readOnlyMode | |
ChronologyProtector | $chronologyProtector | |
BagOStuff | $srvCache | |
WANObjectCache | $wanCache | |
CriticalSectionProvider | $csProvider | |
StatsdDataFactoryInterface | $statsdDataFactory |
Definition at line 111 of file MWLBFactory.php.
MWLBFactory::applyDefaultConfig | ( | array | $lbConf | ) |
array | $lbConf | Config for LBFactory::__construct() |
Definition at line 136 of file MWLBFactory.php.
References DBO_COMPRESS, and Profiler\instance().
MWLBFactory::applyGlobalState | ( | ILBFactory | $lbFactory, |
Config | $config, | ||
IBufferingStatsdDataFactory | $stats ) |
Apply global state from the current web request or other PHP process.
This technically violates the principle constraint on ServiceWiring to be deterministic for a given site configuration. The exemption made here is solely to aid in debugging and influence non-nominal behaviour such as ChronologyProtector. That is, the state applied here must never change the logical destination or meaning of any database-related methods, it merely applies preferences and debugging information.
The code here must be non-essential, with LBFactory behaving the same toward its consumers regardless of whether this is applied or not.
For example, something may instantiate LBFactory for the current wiki without calling this, and its consumers must not be able to tell the difference. Likewise, in the future MediaWiki may instantiate service wiring and LBFactory for a foreign wiki in the same farm and apply the current global state to that, and that should be fine as well.
ILBFactory | $lbFactory | |
Config | $config | |
IBufferingStatsdDataFactory | $stats |
Definition at line 423 of file MWLBFactory.php.
References Wikimedia\Rdbms\ILBFactory\getMainLB(), and Wikimedia\Rdbms\ILBFactory\setWaitForReplicationListener().
MWLBFactory::getLBFactoryClass | ( | array | $config | ) |
Decide which LBFactory class to use.
array | $config | (e.g. $wgLBFactoryConf) |
Definition at line 370 of file MWLBFactory.php.
|
static |
Log a database deprecation warning.
string | $msg | Deprecation message |
Definition at line 459 of file MWLBFactory.php.
References wfGetCaller().
MWLBFactory::setDomainAliases | ( | ILBFactory | $lbFactory | ) |
ILBFactory | $lbFactory |
Definition at line 389 of file MWLBFactory.php.
References Wikimedia\Rdbms\ILBFactory\getLocalDomainID(), and Wikimedia\Rdbms\ILBFactory\setDomainAliases().
const MWLBFactory::APPLY_DEFAULT_CONFIG_OPTIONS |
Definition at line 50 of file MWLBFactory.php.