Remove "@author Aaron Schulz" annotations
[lhc/web/wiklou.git] / includes / libs / rdbms / loadbalancer / ILoadBalancer.php
index 4c277ff..acb4dce 100644 (file)
  *
  * @file
  * @ingroup Database
- * @author Aaron Schulz
  */
 namespace Wikimedia\Rdbms;
 
-use IDatabase;
-use Database;
-use DBConnRef;
-use MaintainableDBConnRef;
-use DBError;
-use DBAccessError;
-use DBTransactionError;
-use DBExpectedError;
 use Exception;
 use InvalidArgumentException;
 
@@ -105,6 +96,7 @@ interface ILoadBalancer {
         *  - srvCache : BagOStuff object for server cache [optional]
         *  - memCache : BagOStuff object for cluster memory cache [optional]
         *  - wanCache : WANObjectCache object [optional]
+        *  - chronologyProtector: ChronologyProtector object [optional]
         *  - hostname : The name of the current server [optional]
         *  - cliMode: Whether the execution context is a CLI script. [optional]
         *  - profiler : Class name or instance with profileIn()/profileOut() methods. [optional]
@@ -138,7 +130,11 @@ interface ILoadBalancer {
         * If a DB_REPLICA connection has been opened already, then wait immediately.
         * Otherwise sets a variable telling it to wait if such a connection is opened.
         *
-        * @param DBMasterPos $pos
+        * This only applies to connections to the generic replica DB for this request.
+        * If a timeout happens when waiting, then getLaggedReplicaMode()/laggedReplicaUsed()
+        * will return true.
+        *
+        * @param DBMasterPos|bool $pos Master position or false
         */
        public function waitFor( $pos );
 
@@ -147,7 +143,7 @@ interface ILoadBalancer {
         *
         * This can be used a faster proxy for waitForAll()
         *
-        * @param DBMasterPos $pos
+        * @param DBMasterPos|bool $pos Master position or false
         * @param int $timeout Max seconds to wait; default is mWaitTimeout
         * @return bool Success (able to connect and no timeouts reached)
         */
@@ -156,7 +152,7 @@ interface ILoadBalancer {
        /**
         * Set the master wait position and wait for ALL replica DBs to catch up to it
         *
-        * @param DBMasterPos $pos
+        * @param DBMasterPos|bool $pos Master position or false
         * @param int $timeout Max seconds to wait; default is mWaitTimeout
         * @return bool Success (able to connect and no timeouts reached)
         */
@@ -289,6 +285,8 @@ interface ILoadBalancer {
         * Return the server info structure for a given index, or false if the index is invalid.
         * @param int $i
         * @return array|bool
+        *
+        * @deprecated Since 1.30, no alternative
         */
        public function getServerInfo( $i );
 
@@ -297,6 +295,8 @@ interface ILoadBalancer {
         * is created if it doesn't exist
         * @param int $i
         * @param array $serverInfo
+        *
+        * @deprecated Since 1.30, construct new object
         */
        public function setServerInfo( $i, array $serverInfo );
 
@@ -443,13 +443,17 @@ interface ILoadBalancer {
        /**
         * @note This method will trigger a DB connection if not yet done
         * @param string|bool $domain Domain ID, or false for the current domain
-        * @return bool Whether the generic connection for reads is highly "lagged"
+        * @return bool Whether the database for generic connections this request is highly "lagged"
         */
        public function getLaggedReplicaMode( $domain = false );
 
        /**
+        * Checks whether the database for generic connections this request was both:
+        *   - a) Already choosen due to a prior connection attempt
+        *   - b) Considered highly "lagged"
+        *
         * @note This method will never cause a new DB connection
-        * @return bool Whether any generic connection used for reads was highly "lagged"
+        * @return bool
         */
        public function laggedReplicaUsed();