PHP Class Predis\Cluster\ClusterStrategy

Author: Daniele Alessandri ([email protected])
Inheritance: implements Predis\Cluster\StrategyInterface
Afficher le fichier Open project: tillkruss/redis-object-cache Class Usage Examples

Protected Properties

Свойство Type Description
$commands

Méthodes publiques

Méthode Description
__construct ( )
getSlot ( Predis\Command\CommandInterface $command )
getSupportedCommands ( ) : array Returns the list of IDs for the supported commands.
setCommandHandler ( string $commandID, mixed $callback = null ) Sets an handler for the specified command ID.

Méthodes protégées

Méthode Description
checkSameSlotForKeys ( array $keys ) : boolean Checks if the specified array of keys will generate the same hash.
extractKeyTag ( string $key ) : string Returns only the hashable part of a key (delimited by "{.
getDefaultCommands ( ) : array Returns the default map of supported commands with their handlers.
getKeyFromAllArguments ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from a command with multiple keys only when all keys in the arguments array produce the same hash.
getKeyFromBitOp ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from BITOP command.
getKeyFromBlockingListCommands ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from BLPOP and BRPOP commands.
getKeyFromFirstArgument ( Predis\Command\CommandInterface $command ) : string Extracts the key from the first argument of a command instance.
getKeyFromGeoradiusCommands ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from GEORADIUS and GEORADIUSBYMEMBER commands.
getKeyFromInterleavedArguments ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from a command with multiple keys only when all keys in the arguments array produce the same hash.
getKeyFromScriptingCommands ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from EVAL and EVALSHA commands.
getKeyFromSortCommand ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from SORT command.
getKeyFromZsetAggregationCommands ( Predis\Command\CommandInterface $command ) : string | null Extracts the key from ZINTERSTORE and ZUNIONSTORE commands.

Method Details

__construct() public méthode

public __construct ( )

checkSameSlotForKeys() protected méthode

Checks if the specified array of keys will generate the same hash.
protected checkSameSlotForKeys ( array $keys ) : boolean
$keys array Array of keys.
Résultat boolean

extractKeyTag() protected méthode

..}"), or the whole key if a key tag is not found in the string.
protected extractKeyTag ( string $key ) : string
$key string A key.
Résultat string

getDefaultCommands() protected méthode

Returns the default map of supported commands with their handlers.
protected getDefaultCommands ( ) : array
Résultat array

getKeyFromAllArguments() protected méthode

Extracts the key from a command with multiple keys only when all keys in the arguments array produce the same hash.
protected getKeyFromAllArguments ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromBitOp() protected méthode

Extracts the key from BITOP command.
protected getKeyFromBitOp ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromBlockingListCommands() protected méthode

Extracts the key from BLPOP and BRPOP commands.
protected getKeyFromBlockingListCommands ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromFirstArgument() protected méthode

Extracts the key from the first argument of a command instance.
protected getKeyFromFirstArgument ( Predis\Command\CommandInterface $command ) : string
$command Predis\Command\CommandInterface Command instance.
Résultat string

getKeyFromGeoradiusCommands() protected méthode

Extracts the key from GEORADIUS and GEORADIUSBYMEMBER commands.
protected getKeyFromGeoradiusCommands ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromInterleavedArguments() protected méthode

Extracts the key from a command with multiple keys only when all keys in the arguments array produce the same hash.
protected getKeyFromInterleavedArguments ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromScriptingCommands() protected méthode

Extracts the key from EVAL and EVALSHA commands.
protected getKeyFromScriptingCommands ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromSortCommand() protected méthode

Extracts the key from SORT command.
protected getKeyFromSortCommand ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getKeyFromZsetAggregationCommands() protected méthode

Extracts the key from ZINTERSTORE and ZUNIONSTORE commands.
protected getKeyFromZsetAggregationCommands ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Résultat string | null

getSlot() public méthode

public getSlot ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface

getSupportedCommands() public méthode

Returns the list of IDs for the supported commands.
public getSupportedCommands ( ) : array
Résultat array

setCommandHandler() public méthode

The signature of the callback must have a single parameter of type Predis\Command\CommandInterface. When the callback argument is omitted or NULL, the previously associated handler for the specified command ID is removed.
public setCommandHandler ( string $commandID, mixed $callback = null )
$commandID string Command ID.
$callback mixed A valid callable object, or NULL to unset the handler.

Property Details

$commands protected_oe property

protected $commands