MediaWiki
REL1_19
|
An interface for generating database load balancers. More...
Public Member Functions | |
__construct ($conf) | |
Construct a factory based on a configuration array (typically from $wgLBFactoryConf) | |
callMethod ($loadBalancer, $methodName, $args) | |
Private helper for forEachLBCallMethod. | |
commitMasterChanges () | |
Commit changes on all master connections. | |
forEachLB ($callback, $params=array()) | |
Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters. | |
forEachLBCallMethod ($methodName, $args=array()) | |
Call a method of each tracked load balancer. | |
& | getExternalLB ($cluster, $wiki=false) |
Get a cached (tracked) load balancer for external storage. | |
getMainLB ($wiki=false) | |
Get a cached (tracked) load balancer object. | |
newExternalLB ($cluster, $wiki=false) | |
Create a new load balancer for external storage. | |
newMainLB ($wiki=false) | |
Create a new load balancer object. | |
shutdown () | |
Prepare all tracked load balancers for shutdown STUB. | |
Static Public Member Functions | |
static | destroyInstance () |
Shut down, close connections and destroy the cached instance. | |
static | disableBackend () |
Disables all access to the load balancer, will cause all database access to throw a DBAccessError. | |
static | setInstance ($instance) |
Set the instance to be the given object. | |
static & | singleton () |
Get an LBFactory instance. | |
Static Public Attributes | |
static | $instance |
An interface for generating database load balancers.
Definition at line 13 of file LBFactory.php.
LBFactory::__construct | ( | $ | conf | ) | [abstract] |
Construct a factory based on a configuration array (typically from $wgLBFactoryConf)
$conf |
Reimplemented in LBFactory_Fake, LBFactory_Simple, LBFactory_Multi, and LBFactory_Single.
LBFactory::callMethod | ( | $ | loadBalancer, |
$ | methodName, | ||
$ | args | ||
) |
Private helper for forEachLBCallMethod.
$loadBalancer | |
$methodName | string |
$args |
Definition at line 139 of file LBFactory.php.
Commit changes on all master connections.
Definition at line 146 of file LBFactory.php.
References forEachLBCallMethod().
Referenced by LBFactory_Simple\shutdown(), and LBFactory_Multi\shutdown().
static LBFactory::destroyInstance | ( | ) | [static] |
Shut down, close connections and destroy the cached instance.
Definition at line 46 of file LBFactory.php.
Referenced by Maintenance\finalSetup(), and setInstance().
static LBFactory::disableBackend | ( | ) | [static] |
Disables all access to the load balancer, will cause all database access to throw a DBAccessError.
Definition at line 24 of file LBFactory.php.
References $wgLBFactoryConf.
Referenced by Installer\__construct().
LBFactory::forEachLB | ( | $ | callback, |
$ | params = array() |
||
) | [abstract] |
Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters.
$callback | string|array | |
array | $params |
Reimplemented in LBFactory_Fake, LBFactory_Multi, LBFactory_Simple, and LBFactory_Single.
Referenced by forEachLBCallMethod().
LBFactory::forEachLBCallMethod | ( | $ | methodName, |
$ | args = array() |
||
) |
Call a method of each tracked load balancer.
$methodName | string |
$args | array |
Definition at line 129 of file LBFactory.php.
References forEachLB().
Referenced by commitMasterChanges().
& LBFactory::getExternalLB | ( | $ | cluster, |
$ | wiki = false |
||
) | [abstract] |
Get a cached (tracked) load balancer for external storage.
$cluster | String: external storage cluster, or false for core |
$wiki | String: wiki ID, or false for the current wiki |
Reimplemented in LBFactory_Fake, LBFactory_Simple, LBFactory_Multi, and LBFactory_Single.
LBFactory::getMainLB | ( | $ | wiki = false | ) | [abstract] |
Get a cached (tracked) load balancer object.
$wiki | String: wiki ID, or false for the current wiki |
Reimplemented in LBFactory_Fake, LBFactory_Simple, LBFactory_Multi, and LBFactory_Single.
LBFactory::newExternalLB | ( | $ | cluster, |
$ | wiki = false |
||
) | [abstract] |
Create a new load balancer for external storage.
The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.
$cluster | String: external storage cluster, or false for core |
$wiki | String: wiki ID, or false for the current wiki |
Reimplemented in LBFactory_Fake, LBFactory_Simple, LBFactory_Multi, and LBFactory_Single.
LBFactory::newMainLB | ( | $ | wiki = false | ) | [abstract] |
Create a new load balancer object.
The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.
$wiki | String: wiki ID, or false for the current wiki |
Reimplemented in LBFactory_Fake, LBFactory_Simple, LBFactory_Multi, and LBFactory_Single.
static LBFactory::setInstance | ( | $ | instance | ) | [static] |
Set the instance to be the given object.
$instance | LBFactory |
Definition at line 59 of file LBFactory.php.
References $instance, and destroyInstance().
Referenced by DatabaseInstaller\enableLB().
Prepare all tracked load balancers for shutdown STUB.
Reimplemented in LBFactory_Multi, and LBFactory_Simple.
Definition at line 122 of file LBFactory.php.
static& LBFactory::singleton | ( | ) | [static] |
Get an LBFactory instance.
Definition at line 34 of file LBFactory.php.
References $instance, and $wgLBFactoryConf.
Referenced by wfGetLBFactory().
LBFactory::$instance [static] |
Definition at line 18 of file LBFactory.php.
Referenced by setInstance(), and singleton().