MediaWiki
REL1_19
|
A multi-wiki, multi-master factory for Wikimedia and similar installations. More...
Public Member Functions | |
__construct ($conf) | |
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. | |
getDBNameAndPrefix ($wiki=false) | |
Get the database name and prefix based on the wiki ID. | |
& | getExternalLB ($cluster, $wiki=false) |
getMainLB ($wiki=false) | |
getSectionForWiki ($wiki=false) | |
makeServerArray ($template, $loads, $groupLoads) | |
Make a server array as expected by LoadBalancer::__construct, using a template and load array. | |
newExternalLB ($cluster, $wiki=false) | |
newLoadBalancer ($template, $loads, $groupLoads) | |
Make a new load balancer object based on template and load array. | |
newMainLB ($wiki=false) | |
reindexGroupLoads ($groupLoads) | |
Take a group load array indexed by group then server, and reindex it by server then group. | |
shutdown () | |
Prepare all tracked load balancers for shutdown STUB. | |
Public Attributes | |
$conf | |
$externalLoads = array() | |
$externalTemplateOverrides | |
$extLBs = array() | |
$groupLoadsByDB = array() | |
$groupLoadsBySection = array() | |
$hostsByName = array() | |
$lastSection | |
$lastWiki | |
$mainLBs = array() | |
$masterTemplateOverrides | |
$readOnlyBySection = array() | |
$sectionLoads | |
$sectionsByDB | |
$serverTemplate | |
$templateOverridesByCluster | |
$templateOverridesByServer |
A multi-wiki, multi-master factory for Wikimedia and similar installations.
Ignores the old configuration globals
Configuration: sectionsByDB A map of database names to section names
sectionLoads A 2-d map. For each section, gives a map of server names to load ratios. For example: array( 'section1' => array( 'db1' => 100, 'db2' => 100 ) )
serverTemplate A server info associative array as documented for $wgDBservers. The host, hostName and load entries will be overridden.
groupLoadsBySection A 3-d map giving server load ratios for each section and group. For example: array( 'section1' => array( 'group1' => array( 'db1' => 100, 'db2' => 100 ) ) )
groupLoadsByDB A 3-d map giving server load ratios by DB name.
hostsByName A map of hostname to IP address.
externalLoads A map of external storage cluster name to server load map
externalTemplateOverrides A set of server info keys overriding serverTemplate for external storage
templateOverridesByServer A 2-d map overriding serverTemplate and externalTemplateOverrides on a server-by-server basis. Applies to both core and external storage.
templateOverridesByCluster A 2-d map overriding the server info by external storage cluster
masterTemplateOverrides An override array for all master servers.
readOnlyBySection A map of section name to read-only message. Missing or false for read/write.
Definition at line 45 of file LBFactory_Multi.php.
LBFactory_Multi::__construct | ( | $ | conf | ) |
$conf | array |
Reimplemented from LBFactory.
Definition at line 59 of file LBFactory_Multi.php.
References $conf, $section, $wgReadOnly, and getSectionForWiki().
LBFactory_Multi::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.
$callback | |
$params | array |
Reimplemented from LBFactory.
Definition at line 270 of file LBFactory_Multi.php.
References $lb.
LBFactory_Multi::getDBNameAndPrefix | ( | $ | wiki = false | ) |
Get the database name and prefix based on the wiki ID.
$wiki | bool |
Definition at line 254 of file LBFactory_Multi.php.
References $wgDBname, $wgDBprefix, and wfSplitWikiID().
Referenced by getSectionForWiki(), and newMainLB().
& LBFactory_Multi::getExternalLB | ( | $ | cluster, |
$ | wiki = false |
||
) |
$cluster | |
$wiki |
Reimplemented from LBFactory.
Definition at line 164 of file LBFactory_Multi.php.
References newExternalLB().
LBFactory_Multi::getMainLB | ( | $ | wiki = false | ) |
$wiki | bool|string |
Reimplemented from LBFactory.
Definition at line 129 of file LBFactory_Multi.php.
References $lb, $section, getSectionForWiki(), and newMainLB().
LBFactory_Multi::getSectionForWiki | ( | $ | wiki = false | ) |
$wiki | bool|string |
Definition at line 93 of file LBFactory_Multi.php.
References $section, and getDBNameAndPrefix().
Referenced by __construct(), getMainLB(), and newMainLB().
LBFactory_Multi::makeServerArray | ( | $ | template, |
$ | loads, | ||
$ | groupLoads | ||
) |
Make a server array as expected by LoadBalancer::__construct, using a template and load array.
$template | |
$loads | array |
$groupLoads |
Definition at line 198 of file LBFactory_Multi.php.
References $serverName, and reindexGroupLoads().
Referenced by newLoadBalancer().
LBFactory_Multi::newExternalLB | ( | $ | cluster, |
$ | wiki = false |
||
) |
$cluster | |
$wiki |
Reimplemented from LBFactory.
Definition at line 145 of file LBFactory_Multi.php.
References newLoadBalancer().
Referenced by getExternalLB().
LBFactory_Multi::newLoadBalancer | ( | $ | template, |
$ | loads, | ||
$ | groupLoads | ||
) |
Make a new load balancer object based on template and load array.
$template | |
$loads | array |
$groupLoads |
Definition at line 180 of file LBFactory_Multi.php.
References $lb, $wgMasterWaitTimeout, and makeServerArray().
Referenced by newExternalLB(), and newMainLB().
LBFactory_Multi::newMainLB | ( | $ | wiki = false | ) |
$wiki | bool|string |
Reimplemented from LBFactory.
Definition at line 112 of file LBFactory_Multi.php.
References $section, getDBNameAndPrefix(), getSectionForWiki(), and newLoadBalancer().
Referenced by getMainLB().
LBFactory_Multi::reindexGroupLoads | ( | $ | groupLoads | ) |
Take a group load array indexed by group then server, and reindex it by server then group.
$groupLoads |
Definition at line 239 of file LBFactory_Multi.php.
Referenced by makeServerArray().
Prepare all tracked load balancers for shutdown STUB.
Reimplemented from LBFactory.
Definition at line 279 of file LBFactory_Multi.php.
References $lb, and LBFactory\commitMasterChanges().
LBFactory_Multi::$conf |
Definition at line 53 of file LBFactory_Multi.php.
Referenced by __construct().
LBFactory_Multi::$externalLoads = array() |
Definition at line 50 of file LBFactory_Multi.php.
LBFactory_Multi::$externalTemplateOverrides |
Definition at line 50 of file LBFactory_Multi.php.
LBFactory_Multi::$extLBs = array() |
Definition at line 53 of file LBFactory_Multi.php.
LBFactory_Multi::$groupLoadsByDB = array() |
Definition at line 49 of file LBFactory_Multi.php.
LBFactory_Multi::$groupLoadsBySection = array() |
Definition at line 49 of file LBFactory_Multi.php.
LBFactory_Multi::$hostsByName = array() |
Definition at line 49 of file LBFactory_Multi.php.
LBFactory_Multi::$lastSection |
Definition at line 54 of file LBFactory_Multi.php.
LBFactory_Multi::$lastWiki |
Definition at line 54 of file LBFactory_Multi.php.
LBFactory_Multi::$mainLBs = array() |
Definition at line 53 of file LBFactory_Multi.php.
LBFactory_Multi::$masterTemplateOverrides |
Definition at line 51 of file LBFactory_Multi.php.
LBFactory_Multi::$readOnlyBySection = array() |
Definition at line 51 of file LBFactory_Multi.php.
LBFactory_Multi::$sectionLoads |
Definition at line 47 of file LBFactory_Multi.php.
LBFactory_Multi::$sectionsByDB |
Definition at line 47 of file LBFactory_Multi.php.
LBFactory_Multi::$serverTemplate |
Definition at line 47 of file LBFactory_Multi.php.
LBFactory_Multi::$templateOverridesByCluster |
Definition at line 51 of file LBFactory_Multi.php.
LBFactory_Multi::$templateOverridesByServer |
Definition at line 50 of file LBFactory_Multi.php.