|
MediaWiki
REL1_23
|
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. | |
Protected Attributes | |
| array | $conf |
| Load balancer factory configuration *. | |
| array | $externalLoads = array() |
| A map of external storage cluster name to server load map *. | |
| array | $externalTemplateOverrides |
| A set of server info keys overriding serverTemplate for external storage. | |
| LoadBalancer[] | $extLBs = array() |
| * | |
| array | $groupLoadsByDB = array() |
| A 3-d map giving server load ratios by DB name *. | |
| array | $groupLoadsBySection = array() |
| A 3-d map giving server load ratios for each section and group *. | |
| array | $hostsByName = array() |
| A map of hostname to IP address *. | |
| string | $lastSection |
| * | |
| string | $lastWiki |
| * | |
| LoadBalancer[] | $mainLBs = array() |
| * | |
| array | $masterTemplateOverrides |
| An override array for all master servers *. | |
| $readOnlyBySection = array() | |
| array | $sectionLoads |
| A 2-d map. | |
| array | $sectionsByDB |
| A map of database names to section names *. | |
| array | $serverTemplate |
| A server info associative array as documented for $wgDBservers. | |
| array | $templateOverridesByCluster |
| A 2-d map overriding the server info by external storage cluster *. | |
| array | $templateOverridesByServer |
| A 2-d map overriding serverTemplate and externalTemplateOverrides on a server-by-server basis. | |
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 76 of file LBFactoryMulti.php.
| LBFactoryMulti::__construct | ( | $ | conf | ) |
| array | $conf |
| MWException |
Reimplemented from LBFactory.
Definition at line 139 of file LBFactoryMulti.php.
| LBFactoryMulti::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.
| callable | $callback | |
| array | $params |
Reimplemented from LBFactory.
Definition at line 366 of file LBFactoryMulti.php.
| LBFactoryMulti::getDBNameAndPrefix | ( | $ | wiki = false | ) |
Get the database name and prefix based on the wiki ID.
| bool | string | $wiki |
Definition at line 349 of file LBFactoryMulti.php.
| & LBFactoryMulti::getExternalLB | ( | $ | cluster, |
| $ | wiki = false |
||
| ) |
| string | $cluster | external storage cluster, or false for core |
| bool | string | $wiki | Wiki ID, or false for the current wiki |
Reimplemented from LBFactory.
Definition at line 254 of file LBFactoryMulti.php.
| LBFactoryMulti::getMainLB | ( | $ | wiki = false | ) |
| bool | string | $wiki |
Reimplemented from LBFactory.
Definition at line 216 of file LBFactoryMulti.php.
| LBFactoryMulti::getSectionForWiki | ( | $ | wiki = false | ) |
| LBFactoryMulti::makeServerArray | ( | $ | template, |
| $ | loads, | ||
| $ | groupLoads | ||
| ) |
Make a server array as expected by LoadBalancer::__construct, using a template and load array.
| array | $template | |
| array | $loads | |
| array | $groupLoads |
Definition at line 291 of file LBFactoryMulti.php.
| LBFactoryMulti::newExternalLB | ( | $ | cluster, |
| $ | wiki = false |
||
| ) |
| string | $cluster | |
| bool | string | $wiki |
| MWException |
Reimplemented from LBFactory.
Definition at line 234 of file LBFactoryMulti.php.
References $lb, $section, array(), and newMainLB().
| LBFactoryMulti::newLoadBalancer | ( | $ | template, |
| $ | loads, | ||
| $ | groupLoads | ||
| ) |
Make a new load balancer object based on template and load array.
| array | $template | |
| array | $loads | |
| array | $groupLoads |
Definition at line 272 of file LBFactoryMulti.php.
| LBFactoryMulti::newMainLB | ( | $ | wiki = false | ) |
| bool | string | $wiki |
Reimplemented from LBFactory.
Definition at line 193 of file LBFactoryMulti.php.
Referenced by newExternalLB().
| LBFactoryMulti::reindexGroupLoads | ( | $ | groupLoads | ) |
Take a group load array indexed by group then server, and reindex it by server then group.
| array | $groupLoads |
Definition at line 333 of file LBFactoryMulti.php.
Prepare all tracked load balancers for shutdown STUB.
Reimplemented from LBFactory.
Definition at line 375 of file LBFactoryMulti.php.
array LBFactoryMulti::$conf [protected] |
Load balancer factory configuration *.
Definition at line 125 of file LBFactoryMulti.php.
A map of external storage cluster name to server load map *.
Definition at line 100 of file LBFactoryMulti.php.
array LBFactoryMulti::$externalTemplateOverrides [protected] |
A set of server info keys overriding serverTemplate for external storage.
Definition at line 105 of file LBFactoryMulti.php.
LoadBalancer [] LBFactoryMulti::$extLBs = array() [protected] |
*
Definition at line 129 of file LBFactoryMulti.php.
A 3-d map giving server load ratios by DB name *.
Definition at line 96 of file LBFactoryMulti.php.
A 3-d map giving server load ratios for each section and group *.
Definition at line 94 of file LBFactoryMulti.php.
A map of hostname to IP address *.
Definition at line 98 of file LBFactoryMulti.php.
string LBFactoryMulti::$lastSection [protected] |
*
Definition at line 133 of file LBFactoryMulti.php.
string LBFactoryMulti::$lastWiki [protected] |
*
Definition at line 131 of file LBFactoryMulti.php.
LoadBalancer [] LBFactoryMulti::$mainLBs = array() [protected] |
*
Definition at line 127 of file LBFactoryMulti.php.
array LBFactoryMulti::$masterTemplateOverrides [protected] |
An override array for all master servers *.
Definition at line 115 of file LBFactoryMulti.php.
LBFactoryMulti::$readOnlyBySection = array() [protected] |
Definition at line 121 of file LBFactoryMulti.php.
array LBFactoryMulti::$sectionLoads [protected] |
A 2-d map.
For each section, gives a map of server names to load ratios
Definition at line 84 of file LBFactoryMulti.php.
array LBFactoryMulti::$sectionsByDB [protected] |
A map of database names to section names *.
Definition at line 79 of file LBFactoryMulti.php.
array LBFactoryMulti::$serverTemplate [protected] |
A server info associative array as documented for $wgDBservers.
The host, hostName and load entries will be overridden
Definition at line 90 of file LBFactoryMulti.php.
array LBFactoryMulti::$templateOverridesByCluster [protected] |
A 2-d map overriding the server info by external storage cluster *.
Definition at line 113 of file LBFactoryMulti.php.
array LBFactoryMulti::$templateOverridesByServer [protected] |
A 2-d map overriding serverTemplate and externalTemplateOverrides on a server-by-server basis.
Applies to both core and external storage
Definition at line 111 of file LBFactoryMulti.php.