Merge "Add GetContentModels hook to allow extensions to enumerate dynamic content...
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / ILBFactory.php
index ff1bd43..3e0800a 100644 (file)
  * @ingroup Database
  */
 
+namespace Wikimedia\Rdbms;
+
+use InvalidArgumentException;
+use ILoadBalancer;
+use LoadBalancer;
+use DBTransactionError;
+use DBReplicationWaitError;
+
 /**
  * An interface for generating database load balancers
  * @ingroup Database
@@ -106,6 +114,22 @@ interface ILBFactory {
         */
        public function getExternalLB( $cluster );
 
+       /**
+        * Get cached (tracked) load balancers for all main database clusters
+        *
+        * @return LoadBalancer[] Map of (cluster name => LoadBalancer)
+        * @since 1.29
+        */
+       public function getAllMainLBs();
+
+       /**
+        * Get cached (tracked) load balancers for all external database clusters
+        *
+        * @return LoadBalancer[] Map of (cluster name => LoadBalancer)
+        * @since 1.29
+        */
+       public function getAllExternalLBs();
+
        /**
         * Execute a function for each tracked load balancer
         * The callback is called with the load balancer as the first parameter,
@@ -162,7 +186,7 @@ interface ILBFactory {
         * @param string $fname Caller name
         * @param array $options Options map:
         *   - maxWriteDuration: abort if more than this much time was spent in write queries
-        * @throws Exception
+        * @throws DBTransactionError
         */
        public function commitMasterChanges( $fname = __METHOD__, array $options = [] );