Commented and re-ordered the LoadBalancer fields
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Sep 2014 18:32:01 +0000 (11:32 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Sep 2014 18:32:01 +0000 (11:32 -0700)
Change-Id: Ie05cfd9a4a60f07ea9710c6bf7657ca956a7dd5e

includes/db/LoadBalancer.php

index db4ed60..e517a02 100644 (file)
  * @ingroup Database
  */
 class LoadBalancer {
-       private $mServers, $mConns, $mLoads, $mGroupLoads;
+       /** @var array Map of (server index => server config array) */
+       private $mServers;
+       /** @var array Map of (local/foreignUsed/foreignFree => server index => DatabaseBase array) */
+       private $mConns;
+       /** @var array Map of (server index => weight) */
+       private $mLoads;
+       /** @var array Map of (group => server index => weight) */
+       private $mGroupLoads;
+       /** @var bool Whether to disregard slave lag as a factor in slave selection */
+       private $mAllowLagged;
+       /** @var integer Seconds to spend waiting on slave lag to resolve */
+       private $mWaitTimeout;
+
+       /** @var array LBFactory information */
+       private $mParentInfo;
+       /** @var string The LoadMonitor subclass name */
+       private $mLoadMonitorClass;
+       /** @var LoadMonitor */
+       private $mLoadMonitor;
 
        /** @var bool|DatabaseBase Database connection that caused a problem */
        private $mErrorConnection;
-       private $mReadIndex, $mAllowLagged;
-
+       /** @var integer The generic (not query grouped) slave index (of $mServers) */
+       private $mReadIndex;
        /** @var bool|DBMasterPos False if not set */
        private $mWaitForPos;
-
-       private $mWaitTimeout;
-       private $mLaggedSlaveMode, $mLastError = 'Unknown error';
-       private $mParentInfo, $mLagTimes;
-       private $mLoadMonitorClass, $mLoadMonitor;
+       /** @var bool Whether the generic reader fell back to a lagged slave */
+       private $mLaggedSlaveMode;
+       /** @var string The last DB selection or connection error */
+       private $mLastError = 'Unknown error';
+       /** @var array Process cache of LoadMonitor::getLagTimes() */
+       private $mLagTimes;
 
        /**
         * @param array $params Array with keys: