dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "RCFilters: Fix highlight circle misalignment"
[lhc/web/wiklou.git]
/
includes
/
libs
/
HashRing.php
diff --git
a/includes/libs/HashRing.php
b/includes/libs/HashRing.php
index
70ce31d
..
be40965
100644
(file)
--- a/
includes/libs/HashRing.php
+++ b/
includes/libs/HashRing.php
@@
-18,7
+18,6
@@
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @author Aaron Schulz
*/
/**
*/
/**
@@
-32,11
+31,11
@@
class HashRing {
/** @var Array (location => (start, end)) */
protected $ring = [];
/** @var Array (location => (start, end)) */
protected $ring = [];
- /** @var
Array (location => (start, end))
*/
+ /** @var
HashRing|null
*/
protected $liveRing;
/** @var Array (location => UNIX timestamp) */
protected $ejectionExpiries = [];
protected $liveRing;
/** @var Array (location => UNIX timestamp) */
protected $ejectionExpiries = [];
- /** @var int
eger
UNIX timestamp */
+ /** @var int UNIX timestamp */
protected $ejectionNextExpiry = INF;
const RING_SIZE = 268435456; // 2^28
protected $ejectionNextExpiry = INF;
const RING_SIZE = 268435456; // 2^28
@@
-94,7
+93,7
@@
class HashRing {
* Get the location of an item on the ring, as well as the next locations
*
* @param string $item
* Get the location of an item on the ring, as well as the next locations
*
* @param string $item
- * @param int
eger
$limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
*/
public function getLocations( $item, $limit ) {
* @return array List of locations
*/
public function getLocations( $item, $limit ) {
@@
-153,7
+152,7
@@
class HashRing {
* Remove a location from the "live" hash ring
*
* @param string $location
* Remove a location from the "live" hash ring
*
* @param string $location
- * @param int
eger
$ttl Seconds
+ * @param int $ttl Seconds
* @return bool Whether some non-ejected locations are left
*/
public function ejectFromLiveRing( $location, $ttl ) {
* @return bool Whether some non-ejected locations are left
*/
public function ejectFromLiveRing( $location, $ttl ) {
@@
-179,7
+178,7
@@
class HashRing {
if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) {
$this->ejectionExpiries = array_filter(
$this->ejectionExpiries,
if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) {
$this->ejectionExpiries = array_filter(
$this->ejectionExpiries,
- function( $expiry ) use ( $now ) {
+ function
( $expiry ) use ( $now ) {
return ( $expiry > $now );
}
);
return ( $expiry > $now );
}
);
@@
-219,7
+218,7
@@
class HashRing {
* Get the location of an item on the "live" ring, as well as the next locations
*
* @param string $item
* Get the location of an item on the "live" ring, as well as the next locations
*
* @param string $item
- * @param int
eger
$limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
* @throws UnexpectedValueException
*/
* @return array List of locations
* @throws UnexpectedValueException
*/