From 45a6a7ad6771ed4c94f7a9c568ffeeca4935ca87 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 17 Mar 2018 21:22:56 -0700 Subject: [PATCH] Set visiblity of some HashRing methods * getLiveRing() is now protected * getLocation() is now final Change-Id: I16002fe7187d8bbb6e36d4dd9a1302ee1d46a4bb --- includes/jobqueue/JobQueueFederated.php | 2 +- includes/libs/HashRing.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/jobqueue/JobQueueFederated.php b/includes/jobqueue/JobQueueFederated.php index 118b0f9525..7f3b2b1d59 100644 --- a/includes/jobqueue/JobQueueFederated.php +++ b/includes/jobqueue/JobQueueFederated.php @@ -187,7 +187,7 @@ class JobQueueFederated extends JobQueue { // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $i = $this->maxPartitionsTry; $i > 0 && count( $jobsLeft ); --$i ) { try { - $partitionRing->getLiveRing(); + $partitionRing->getLiveLocationWeights(); } catch ( UnexpectedValueException $e ) { break; // all servers down; nothing to insert to } diff --git a/includes/libs/HashRing.php b/includes/libs/HashRing.php index 21558f77b6..66121303bc 100644 --- a/includes/libs/HashRing.php +++ b/includes/libs/HashRing.php @@ -83,7 +83,7 @@ class HashRing { * @param string $item * @return string Location */ - public function getLocation( $item ) { + final public function getLocation( $item ) { $locations = $this->getLocations( $item, 1 ); return $locations[0]; @@ -174,7 +174,7 @@ class HashRing { * @return HashRing * @throws UnexpectedValueException */ - public function getLiveRing() { + protected function getLiveRing() { $now = time(); if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) { $this->ejectionExpiries = array_filter( -- 2.20.1