Inherits LBFactory.
Public Member Functions | |
| __construct ($conf) | |
| Construct a factory based on a configuration array (typically from $wgLBFactoryConf). | |
| getSectionForWiki ($wiki=false) | |
| newMainLB ($wiki=false) | |
| Create a new load balancer object. | |
| getMainLB ($wiki=false) | |
| Get a cached (tracked) load balancer object. | |
| newExternalLB ($cluster, $wiki=false) | |
| & | getExternalLB ($cluster, $wiki=false) |
| newLoadBalancer ($template, $loads, $groupLoads) | |
| Make a new load balancer object based on template and load array. | |
| makeServerArray ($template, $loads, $groupLoads) | |
| Make a server array as expected by LoadBalancer::__construct, using a template and load array. | |
| reindexGroupLoads ($groupLoads) | |
| Take a group load array indexed by group then server, and reindex it by server then group. | |
| getDBNameAndPrefix ($wiki=false) | |
| Get the database name and prefix based on the wiki ID. | |
| 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. | |
| shutdown () | |
| Prepare all tracked load balancers for shutdown STUB. | |
Public Attributes | |
| $sectionsByDB | |
| $sectionLoads | |
| $serverTemplate | |
| $groupLoadsBySection = array() | |
| $groupLoadsByDB = array() | |
| $hostsByName = array() | |
| $externalLoads = array() | |
| $externalTemplateOverrides | |
| $templateOverridesByServer | |
| $templateOverridesByCluster | |
| $masterTemplateOverrides | |
| $readOnlyBySection = array() | |
| $conf | |
| $mainLBs = array() | |
| $extLBs = array() | |
| $lastWiki | |
| $lastSection | |
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 43 of file LBFactory_Multi.php.
| LBFactory_Multi::__construct | ( | $ | conf | ) |
Construct a factory based on a configuration array (typically from $wgLBFactoryConf).
Reimplemented from LBFactory.
Definition at line 54 of file LBFactory_Multi.php.
References $conf, $key, $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.
Reimplemented from LBFactory.
Definition at line 227 of file LBFactory_Multi.php.
References $lb.
| LBFactory_Multi::getDBNameAndPrefix | ( | $ | wiki = false |
) |
Get the database name and prefix based on the wiki ID.
Definition at line 213 of file LBFactory_Multi.php.
References $wgDBname, $wgDBprefix, and wfSplitWikiID().
Referenced by getSectionForWiki(), and newMainLB().
| & LBFactory_Multi::getExternalLB | ( | $ | cluster, | |
| $ | wiki = false | |||
| ) |
Reimplemented from LBFactory.
Definition at line 137 of file LBFactory_Multi.php.
References newExternalLB().
| LBFactory_Multi::getMainLB | ( | $ | wiki = false |
) |
Get a cached (tracked) load balancer object.
| string | $wiki Wiki ID, or false for the current wiki |
Reimplemented from LBFactory.
Definition at line 112 of file LBFactory_Multi.php.
References $lb, $section, getSectionForWiki(), and newMainLB().
| LBFactory_Multi::getSectionForWiki | ( | $ | wiki = false |
) |
Definition at line 84 of file LBFactory_Multi.php.
References $prefix, $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.
Definition at line 161 of file LBFactory_Multi.php.
References reindexGroupLoads().
Referenced by newLoadBalancer().
| LBFactory_Multi::newExternalLB | ( | $ | cluster, | |
| $ | wiki = false | |||
| ) |
Reimplemented from LBFactory.
Definition at line 123 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.
Definition at line 148 of file LBFactory_Multi.php.
References $lb, $wgMasterWaitTimeout, and makeServerArray().
Referenced by newExternalLB(), and newMainLB().
| LBFactory_Multi::newMainLB | ( | $ | wiki = false |
) |
Create a new load balancer object.
The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.
| string | $wiki Wiki ID, or false for the current wiki |
Reimplemented from LBFactory.
Definition at line 99 of file LBFactory_Multi.php.
References $prefix, $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.
Definition at line 200 of file LBFactory_Multi.php.
Referenced by makeServerArray().
| LBFactory_Multi::shutdown | ( | ) |
Prepare all tracked load balancers for shutdown STUB.
Reimplemented from LBFactory.
Definition at line 236 of file LBFactory_Multi.php.
References $lb, and LBFactory::commitMasterChanges().
| LBFactory_Multi::$conf |
| LBFactory_Multi::$externalLoads = array() |
Definition at line 48 of file LBFactory_Multi.php.
| LBFactory_Multi::$externalTemplateOverrides |
Definition at line 48 of file LBFactory_Multi.php.
| LBFactory_Multi::$extLBs = array() |
Definition at line 51 of file LBFactory_Multi.php.
| LBFactory_Multi::$groupLoadsByDB = array() |
Definition at line 47 of file LBFactory_Multi.php.
| LBFactory_Multi::$groupLoadsBySection = array() |
Definition at line 47 of file LBFactory_Multi.php.
| LBFactory_Multi::$hostsByName = array() |
Definition at line 47 of file LBFactory_Multi.php.
| LBFactory_Multi::$lastSection |
Definition at line 52 of file LBFactory_Multi.php.
| LBFactory_Multi::$lastWiki |
Definition at line 52 of file LBFactory_Multi.php.
| LBFactory_Multi::$mainLBs = array() |
Definition at line 51 of file LBFactory_Multi.php.
| LBFactory_Multi::$masterTemplateOverrides |
Definition at line 49 of file LBFactory_Multi.php.
| LBFactory_Multi::$readOnlyBySection = array() |
Definition at line 49 of file LBFactory_Multi.php.
| LBFactory_Multi::$sectionLoads |
Definition at line 45 of file LBFactory_Multi.php.
| LBFactory_Multi::$sectionsByDB |
Definition at line 45 of file LBFactory_Multi.php.
| LBFactory_Multi::$serverTemplate |
Definition at line 45 of file LBFactory_Multi.php.
| LBFactory_Multi::$templateOverridesByCluster |
Definition at line 49 of file LBFactory_Multi.php.
| LBFactory_Multi::$templateOverridesByServer |
Definition at line 48 of file LBFactory_Multi.php.
1.5.9