*/
use Psr\Log\LoggerInterface;
+use Wikimedia\ScopedCallback;
/**
* An interface for generating database load balancers
$this->errorLogger = isset( $conf['errorLogger'] )
? $conf['errorLogger']
: function ( Exception $e ) {
- trigger_error( E_WARNING, get_class( $e ) . ': ' . $e->getMessage() );
+ trigger_error( E_USER_WARNING, get_class( $e ) . ': ' . $e->getMessage() );
};
$this->profiler = isset( $params['profiler'] ) ? $params['profiler'] : null;
$this->commitMasterChanges( __METHOD__ ); // sanity
}
+ /**
+ * @see ILBFactory::newMainLB()
+ * @param bool $domain
+ * @return LoadBalancer
+ */
+ abstract public function newMainLB( $domain = false );
+
+ /**
+ * @see ILBFactory::getMainLB()
+ * @param bool $domain
+ * @return LoadBalancer
+ */
+ abstract public function getMainLB( $domain = false );
+
+ /**
+ * @see ILBFactory::newExternalLB()
+ * @param string $cluster
+ * @return LoadBalancer
+ */
+ abstract public function newExternalLB( $cluster );
+
+ /**
+ * @see ILBFactory::getExternalLB()
+ * @param string $cluster
+ * @return LoadBalancer
+ */
+ abstract public function getExternalLB( $cluster );
+
/**
* Call a method of each tracked load balancer
*
if ( $failed ) {
throw new DBReplicationWaitError(
+ null,
"Could not wait for replica DBs to catch up to " .
implode( ', ', $failed )
);