[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/db/ -> LBFactoryMulti.php (summary)

Advanced generator of database load balancing objects for wiki farms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 399 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

LBFactoryMulti:: (12 methods):
  __construct()
  getSectionForWiki()
  newMainLB()
  getMainLB()
  newExternalLB()
  getExternalLB()
  newLoadBalancer()
  makeServerArray()
  reindexGroupLoads()
  getDBNameAndPrefix()
  forEachLB()
  shutdown()


Class: LBFactoryMulti  - X-Ref

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.

__construct( $conf )   X-Ref

param: array $conf

getSectionForWiki( $wiki = false )   X-Ref

param: bool|string $wiki
return: string

newMainLB( $wiki = false )   X-Ref

param: bool|string $wiki
return: LoadBalancer

getMainLB( $wiki = false )   X-Ref

param: bool|string $wiki
return: LoadBalancer

newExternalLB( $cluster, $wiki = false )   X-Ref

param: string $cluster
param: bool|string $wiki
return: LoadBalancer

getExternalLB( $cluster, $wiki = false )   X-Ref

param: string $cluster External storage cluster, or false for core
param: bool|string $wiki Wiki ID, or false for the current wiki
return: LoadBalancer

newLoadBalancer( $template, $loads, $groupLoads )   X-Ref
Make a new load balancer object based on template and load array

param: array $template
param: array $loads
param: array $groupLoads
return: LoadBalancer

makeServerArray( $template, $loads, $groupLoads )   X-Ref
Make a server array as expected by LoadBalancer::__construct, using a template and load array

param: array $template
param: array $loads
param: array $groupLoads
return: array

reindexGroupLoads( $groupLoads )   X-Ref
Take a group load array indexed by group then server, and reindex it by server then group

param: array $groupLoads
return: array

getDBNameAndPrefix( $wiki = false )   X-Ref
Get the database name and prefix based on the wiki ID

param: bool|string $wiki
return: array

forEachLB( $callback, $params = array()   X-Ref
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.

param: callable $callback
param: array $params

shutdown()   X-Ref
No description



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1