PHP Interface Predis\Cluster\Distributor\DistributorInterface

Author: Daniele Alessandri ([email protected])
Datei anzeigen Open project: tillkruss/redis-object-cache Interface Usage Examples

Public Methods

Method Description
add ( mixed $node, integer $weight = null ) Adds a node to the distributor with an optional weight.
get ( string $value ) : mixed Returns a node from the distributor mapping to the specified value.
getByHash ( mixed $hash ) : mixed Returns a node from the distributor using the computed hash of a key.
getBySlot ( mixed $slot ) : mixed | null Returns a node from the distributor using its assigned slot ID.
getHashGenerator ( ) : Predis\Cluster\Hash\HashGeneratorInterface Returns the underlying hash generator instance.
getSlot ( mixed $hash ) : mixed Returns the corresponding slot of a node from the distributor using the computed hash of a key.
remove ( mixed $node ) Removes a node from the distributor.

Method Details

add() public method

Adds a node to the distributor with an optional weight.
public add ( mixed $node, integer $weight = null )
$node mixed Node object.
$weight integer Weight for the node.

get() public method

Returns a node from the distributor mapping to the specified value.
public get ( string $value ) : mixed
$value string
return mixed

getByHash() public method

Returns a node from the distributor using the computed hash of a key.
public getByHash ( mixed $hash ) : mixed
$hash mixed
return mixed

getBySlot() public method

Returns a node from the distributor using its assigned slot ID.
public getBySlot ( mixed $slot ) : mixed | null
$slot mixed
return mixed | null

getHashGenerator() public method

Returns the underlying hash generator instance.
public getHashGenerator ( ) : Predis\Cluster\Hash\HashGeneratorInterface
return Predis\Cluster\Hash\HashGeneratorInterface

getSlot() public method

Returns the corresponding slot of a node from the distributor using the computed hash of a key.
public getSlot ( mixed $hash ) : mixed
$hash mixed
return mixed

remove() public method

Removes a node from the distributor.
public remove ( mixed $node )
$node mixed Node object.