* @since 1.22
*/
class HashRing {
- /** @var Array (location => weight) */
+ /** @var array (location => weight) */
protected $sourceMap = [];
- /** @var Array (location => (start, end)) */
+ /** @var array (location => (start, end)) */
protected $ring = [];
/** @var HashRing|null */
protected $liveRing;
- /** @var Array (location => UNIX timestamp) */
+ /** @var array (location => UNIX timestamp) */
protected $ejectionExpiries = [];
/** @var int UNIX timestamp */
protected $ejectionNextExpiry = INF;
* @param string $item
* @return string Location
*/
- public function getLocation( $item ) {
+ final public function getLocation( $item ) {
$locations = $this->getLocations( $item, 1 );
return $locations[0];
* @return HashRing
* @throws UnexpectedValueException
*/
- public function getLiveRing() {
+ protected function getLiveRing() {
$now = time();
if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) {
$this->ejectionExpiries = array_filter(