PHP Класс Predis\Cluster\SlotMap

Наследование: implements ArrayAccess, implements IteratorAggregate, implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
count ( ) : integer Returns the current number of assigned slots.
getIterator ( ) : ArrayIterator Returns an iterator over the slot map.
getNodes ( ) : array Returns the list of unique nodes in the slot map.
getSlots ( integer $first, integer $last ) : array Returns the specified slot range.
isEmpty ( ) : boolean Checks if the slot map is empty.
isValid ( $slot ) : boolean Checks if the given slot is valid.
isValidRange ( integer $first, integer $last ) : boolean Checks if the given slot range is valid.
offsetExists ( integer $slot ) : boolean Checks if the specified slot is assigned.
offsetGet ( integer $slot ) : string Returns the node assigned to the specified slot.
offsetSet ( integer $slot, NodeConnectionInterface | string $connection ) : string Assigns the specified slot to a node.
offsetUnset ( integer $slot ) : string Returns the node assigned to the specified slot.
reset ( ) Resets the slot map.
setSlots ( integer $first, integer $last, NodeConnectionInterface | string $connection ) Assigns the specified slot range to a node.
toArray ( ) : array Returns the current slot map as a dictionary of $slot => $node.

Описание методов

count() публичный Метод

Returns the current number of assigned slots.
public count ( ) : integer
Результат integer

getIterator() публичный Метод

Returns an iterator over the slot map.
public getIterator ( ) : ArrayIterator
Результат ArrayIterator

getNodes() публичный Метод

Returns the list of unique nodes in the slot map.
public getNodes ( ) : array
Результат array

getSlots() публичный Метод

Returns the specified slot range.
public getSlots ( integer $first, integer $last ) : array
$first integer Initial slot of the range.
$last integer Last slot of the range.
Результат array

isEmpty() публичный Метод

Checks if the slot map is empty.
public isEmpty ( ) : boolean
Результат boolean

isValid() публичный статический Метод

Checks if the given slot is valid.
public static isValid ( $slot ) : boolean
Результат boolean

isValidRange() публичный статический Метод

Checks if the given slot range is valid.
public static isValidRange ( integer $first, integer $last ) : boolean
$first integer Initial slot of the range.
$last integer Last slot of the range.
Результат boolean

offsetExists() публичный Метод

Checks if the specified slot is assigned.
public offsetExists ( integer $slot ) : boolean
$slot integer Slot index.
Результат boolean

offsetGet() публичный Метод

Returns the node assigned to the specified slot.
public offsetGet ( integer $slot ) : string
$slot integer Slot index.
Результат string

offsetSet() публичный Метод

Assigns the specified slot to a node.
public offsetSet ( integer $slot, NodeConnectionInterface | string $connection ) : string
$slot integer Slot index.
$connection NodeConnectionInterface | string ID or connection instance.
Результат string

offsetUnset() публичный Метод

Returns the node assigned to the specified slot.
public offsetUnset ( integer $slot ) : string
$slot integer Slot index.
Результат string

reset() публичный Метод

Resets the slot map.
public reset ( )

setSlots() публичный Метод

Assigns the specified slot range to a node.
public setSlots ( integer $first, integer $last, NodeConnectionInterface | string $connection )
$first integer Initial slot of the range.
$last integer Last slot of the range.
$connection NodeConnectionInterface | string ID or connection instance.

toArray() публичный Метод

The order of the slots in the dictionary is not guaranteed.
public toArray ( ) : array
Результат array