summaryrefslogtreecommitdiff
path: root/includes/db/LBFactory_Multi.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/db/LBFactory_Multi.php')
-rw-r--r--includes/db/LBFactory_Multi.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/db/LBFactory_Multi.php b/includes/db/LBFactory_Multi.php
index 0d411ec6..61e56e78 100644
--- a/includes/db/LBFactory_Multi.php
+++ b/includes/db/LBFactory_Multi.php
@@ -98,6 +98,10 @@ class LBFactory_Multi extends LBFactory {
return $section;
}
+ /**
+ * @param $wiki string
+ * @return LoadBalancer
+ */
function newMainLB( $wiki = false ) {
list( $dbName, ) = $this->getDBNameAndPrefix( $wiki );
$section = $this->getSectionForWiki( $wiki );
@@ -111,6 +115,10 @@ class LBFactory_Multi extends LBFactory {
return $this->newLoadBalancer( $this->serverTemplate, $this->sectionLoads[$section], $groupLoads );
}
+ /**
+ * @param $wiki
+ * @return LoadBalancer
+ */
function getMainLB( $wiki = false ) {
$section = $this->getSectionForWiki( $wiki );
if ( !isset( $this->mainLBs[$section] ) ) {
@@ -122,6 +130,11 @@ class LBFactory_Multi extends LBFactory {
return $this->mainLBs[$section];
}
+ /**
+ * @param $cluster
+ * @param $wiki
+ * @return LoadBalancer
+ */
function newExternalLB( $cluster, $wiki = false ) {
if ( !isset( $this->externalLoads[$cluster] ) ) {
throw new MWException( __METHOD__.": Unknown cluster \"$cluster\"" );
@@ -136,6 +149,11 @@ class LBFactory_Multi extends LBFactory {
return $this->newLoadBalancer( $template, $this->externalLoads[$cluster], array() );
}
+ /**
+ * @param $cluster
+ * @param $wiki
+ * @return LoadBalancer
+ */
function &getExternalLB( $cluster, $wiki = false ) {
if ( !isset( $this->extLBs[$cluster] ) ) {
$this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki );
@@ -146,6 +164,8 @@ class LBFactory_Multi extends LBFactory {
/**
* Make a new load balancer object based on template and load array
+ *
+ * @return LoadBalancer
*/
function newLoadBalancer( $template, $loads, $groupLoads ) {
global $wgMasterWaitTimeout;
@@ -159,6 +179,8 @@ class LBFactory_Multi extends LBFactory {
/**
* Make a server array as expected by LoadBalancer::__construct, using a template and load array
+ *
+ * @return array
*/
function makeServerArray( $template, $loads, $groupLoads ) {
$servers = array();