* Create a new load balancer object. The resulting object will be untracked,
* not chronology-protected, and the caller is responsible for cleaning it up.
*
+ * This method is for only advanced usage and callers should almost always use
+ * getMainLB() instead. This method can be useful when a table is used as a key/value
+ * store. In that cases, one might want to query it in autocommit mode (DBO_TRX off)
+ * but still use DBO_TRX transaction rounds on other tables.
+ *
* @param bool|string $domain Domain ID, or false for the current domain
* @return ILoadBalancer
*/
* untracked, not chronology-protected, and the caller is responsible for
* cleaning it up.
*
+ * This method is for only advanced usage and callers should almost always use
+ * getExternalLB() instead. This method can be useful when a table is used as a
+ * key/value store. In that cases, one might want to query it in autocommit mode
+ * (DBO_TRX off) but still use DBO_TRX transaction rounds on other tables.
+ *
* @param string $cluster External storage cluster, or false for core
* @param bool|string $domain Domain ID, or false for the current domain
* @return ILoadBalancer
*/
- abstract protected function newExternalLB( $cluster, $domain = false );
+ abstract public function newExternalLB( $cluster, $domain = false );
/**
* Get a cached (tracked) load balancer for external storage
* @throws InvalidArgumentException
* @return LoadBalancer
*/
- protected function newExternalLB( $cluster, $domain = false ) {
+ public function newExternalLB( $cluster, $domain = false ) {
if ( !isset( $this->externalLoads[$cluster] ) ) {
throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"" );
}
* @return LoadBalancer
* @throws InvalidArgumentException
*/
- protected function newExternalLB( $cluster, $domain = false ) {
+ public function newExternalLB( $cluster, $domain = false ) {
if ( !isset( $this->externalClusters[$cluster] ) ) {
throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"." );
}
* @param bool|string $wiki Wiki ID, or false for the current wiki
* @return LoadBalancerSingle
*/
- protected function newExternalLB( $cluster, $wiki = false ) {
+ public function newExternalLB( $cluster, $wiki = false ) {
return $this->lb;
}