[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make newExternalLB() public to match newMainLB()

2016-09-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make newExternalLB() public to match newMainLB()
..


Make newExternalLB() public to match newMainLB()

Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
---
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/lbfactory/LBFactoryMulti.php
M includes/libs/rdbms/lbfactory/LBFactorySimple.php
M includes/libs/rdbms/lbfactory/LBFactorySingle.php
4 files changed, 14 insertions(+), 4 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index aa932aa..fd89f33 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -157,6 +157,11 @@
 * 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
 */
@@ -175,11 +180,16 @@
 * 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
diff --git a/includes/libs/rdbms/lbfactory/LBFactoryMulti.php 
b/includes/libs/rdbms/lbfactory/LBFactoryMulti.php
index 25e1fe0..6993dac 100644
--- a/includes/libs/rdbms/lbfactory/LBFactoryMulti.php
+++ b/includes/libs/rdbms/lbfactory/LBFactoryMulti.php
@@ -261,7 +261,7 @@
 * @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\"" );
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactorySimple.php 
b/includes/libs/rdbms/lbfactory/LBFactorySimple.php
index 4ed4347..610052f 100644
--- a/includes/libs/rdbms/lbfactory/LBFactorySimple.php
+++ b/includes/libs/rdbms/lbfactory/LBFactorySimple.php
@@ -97,7 +97,7 @@
 * @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\"." );
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactorySingle.php 
b/includes/libs/rdbms/lbfactory/LBFactorySingle.php
index 4beb5d8..af4a350 100644
--- a/includes/libs/rdbms/lbfactory/LBFactorySingle.php
+++ b/includes/libs/rdbms/lbfactory/LBFactorySingle.php
@@ -73,7 +73,7 @@
 * @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;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/312466
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make newExternalLB() public to match newMainLB()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312466

Change subject: Make newExternalLB() public to match newMainLB()
..

Make newExternalLB() public to match newMainLB()

Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
---
M includes/libs/rdbms/lbfactory/LBFactory.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/312466/1

diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index aa932aa..fd89f33 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -157,6 +157,11 @@
 * 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
 */
@@ -175,11 +180,16 @@
 * 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

-- 
To view, visit https://gerrit.wikimedia.org/r/312466
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits