Make LBFactorySingle external LB methods throw exceptions
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 3 Nov 2016 21:01:08 +0000 (14:01 -0700)
committerReedy <reedy@wikimedia.org>
Thu, 3 Nov 2016 23:30:46 +0000 (23:30 +0000)
There are no external clusters with this LB factory class,
so calling these methods makes no sense.

Change-Id: I63a9c6c76ba036980cfaab3ef03574295e46c6bf

includes/libs/rdbms/lbfactory/LBFactorySingle.php

index e116888..9424614 100644 (file)
@@ -70,20 +70,12 @@ class LBFactorySingle extends LBFactory {
                return $this->lb;
        }
 
-       /**
-        * @param string $cluster External storage cluster name (unused)
-        * @return LoadBalancerSingle
-        */
        public function newExternalLB( $cluster ) {
-               return $this->lb;
+               throw new BadMethodCallException( "Method is not supported." );
        }
 
-       /**
-        * @param string $cluster External storage cluster name (unused)
-        * @return LoadBalancerSingle
-        */
        public function getExternalLB( $cluster ) {
-               return $this->lb;
+               throw new BadMethodCallException( "Method is not supported." );
        }
 
        /**