From 4c3b7441f06a177c5ac7a51d01371d29d66704ad Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 24 Jun 2019 13:45:01 -0700 Subject: [PATCH] rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad() This methods are not used anywhere and have no known use case. Change-Id: I213d7b9cfacb5a966fe5ce9c7b377e1d4eb2cec9 --- RELEASE-NOTES-1.34 | 2 ++ .../libs/rdbms/loadbalancer/ILoadBalancer.php | 16 ---------------- .../libs/rdbms/loadbalancer/LoadBalancer.php | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index fdc9e055e2..acd82d63be 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -327,6 +327,8 @@ because of Phabricator reports. engines. * Skin::escapeSearchLink() is deprecated. Use Skin::getSearchLink() or the skin template option 'searchaction' instead. +* LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad() have + been deprecated. === Other changes in 1.34 === * … diff --git a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php index 4d148b4c90..b086beb31c 100644 --- a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php @@ -314,22 +314,6 @@ interface ILoadBalancer { */ public function getWriterIndex(); - /** - * Returns true if the specified index is a valid server index - * - * @param int $i - * @return bool - */ - public function haveIndex( $i ); - - /** - * Returns true if the specified index is valid and has non-zero load - * - * @param int $i - * @return bool - */ - public function isNonZeroLoad( $i ); - /** * Get the number of servers defined in configuration * diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 7f12d14bb0..44d526c2e2 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -1306,10 +1306,24 @@ class LoadBalancer implements ILoadBalancer { return 0; } + /** + * Returns true if the specified index is a valid server index + * + * @param int $i + * @return bool + * @deprecated Since 1.34 + */ public function haveIndex( $i ) { return array_key_exists( $i, $this->servers ); } + /** + * Returns true if the specified index is valid and has non-zero load + * + * @param int $i + * @return bool + * @deprecated Since 1.34 + */ public function isNonZeroLoad( $i ) { return array_key_exists( $i, $this->servers ) && $this->genericLoads[$i] != 0; } -- 2.20.1