MediaWiki  REL1_19
LBFactory_Multi Class Reference

A multi-wiki, multi-master factory for Wikimedia and similar installations. More...

Inheritance diagram for LBFactory_Multi:
Collaboration diagram for LBFactory_Multi:

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

Parameters:
$confarray

Reimplemented from LBFactory.

Definition at line 59 of file LBFactory_Multi.php.

References $conf, $section, $wgReadOnly, and getSectionForWiki().

Here is the call graph for this function:


Member Function Documentation

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.

Parameters:
$callback
$paramsarray

Reimplemented from LBFactory.

Definition at line 270 of file LBFactory_Multi.php.

References $lb.

Get the database name and prefix based on the wiki ID.

Parameters:
$wikibool
Returns:
array

Definition at line 254 of file LBFactory_Multi.php.

References $wgDBname, $wgDBprefix, and wfSplitWikiID().

Referenced by getSectionForWiki(), and newMainLB().

Here is the call graph for this function:

Here is the caller graph for this function:

& LBFactory_Multi::getExternalLB ( cluster,
wiki = false 
)
Parameters:
$cluster
$wiki
Returns:
LoadBalancer

Reimplemented from LBFactory.

Definition at line 164 of file LBFactory_Multi.php.

References newExternalLB().

Here is the call graph for this function:

Parameters:
$wikibool|string
Returns:
LoadBalancer

Reimplemented from LBFactory.

Definition at line 129 of file LBFactory_Multi.php.

References $lb, $section, getSectionForWiki(), and newMainLB().

Here is the call graph for this function:

Parameters:
$wikibool|string
Returns:
string

Definition at line 93 of file LBFactory_Multi.php.

References $section, and getDBNameAndPrefix().

Referenced by __construct(), getMainLB(), and newMainLB().

Here is the call graph for this function:

Here is the caller graph for this function:

LBFactory_Multi::makeServerArray ( template,
loads,
groupLoads 
)

Make a server array as expected by LoadBalancer::__construct, using a template and load array.

Parameters:
$template
$loadsarray
$groupLoads
Returns:
array

Definition at line 198 of file LBFactory_Multi.php.

References $serverName, and reindexGroupLoads().

Referenced by newLoadBalancer().

Here is the call graph for this function:

Here is the caller graph for this function:

LBFactory_Multi::newExternalLB ( cluster,
wiki = false 
)
Parameters:
$cluster
$wiki
Returns:
LoadBalancer

Reimplemented from LBFactory.

Definition at line 145 of file LBFactory_Multi.php.

References newLoadBalancer().

Referenced by getExternalLB().

Here is the call graph for this function:

Here is the caller graph for this function:

LBFactory_Multi::newLoadBalancer ( template,
loads,
groupLoads 
)

Make a new load balancer object based on template and load array.

Parameters:
$template
$loadsarray
$groupLoads
Returns:
LoadBalancer

Definition at line 180 of file LBFactory_Multi.php.

References $lb, $wgMasterWaitTimeout, and makeServerArray().

Referenced by newExternalLB(), and newMainLB().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$wikibool|string
Returns:
LoadBalancer

Reimplemented from LBFactory.

Definition at line 112 of file LBFactory_Multi.php.

References $section, getDBNameAndPrefix(), getSectionForWiki(), and newLoadBalancer().

Referenced by getMainLB().

Here is the call graph for this function:

Here is the caller graph for this function:

Take a group load array indexed by group then server, and reindex it by server then group.

Parameters:
$groupLoads
Returns:
array

Definition at line 239 of file LBFactory_Multi.php.

Referenced by makeServerArray().

Here is the caller graph for this function:

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().

Here is the call graph for this function:


Member Data Documentation

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.


The documentation for this class was generated from the following file: