Property | Type | Description | |
---|---|---|---|
$aliases | array | Aliases of Credis_Client objects attached to Redis servers, used to route commands to specific servers | |
$clients | Credis_Client[] | Collection of Credis_Client objects attached to Redis servers | |
$dont_hash | array | The commands that are not subject to hashing | |
$masterClient | Credis_Client | If a server is set as master, all write commands go to that one | |
$nodes | array | Individual nodes of pointers to Redis servers on the hash ring | |
$ring | array | Hash ring of Redis server nodes | |
$selectedDb | integer | Currently working cluster-wide database number. |
Method | Description | |
---|---|---|
__call ( string $name, array $args ) : mixed | Execute a Redis command on the cluster with automatic consistent hashing and read/write splitting | |
__construct ( array $servers, integer $replicas = 128, boolean $standAlone = false ) | Creates an interface to a cluster of Redis servers Each server should be in the format: array( 'host' => hostname, 'port' => port, 'db' => db, 'password' => password, 'timeout' => timeout, 'alias' => alias, 'persistent' => persistence_identifier, 'master' => master 'write_only'=> true/false ) | |
all ( ) : array | Execute a command on all clients | |
byHash ( string $key ) : Credis_Client | Get the client that the key would hash to. | |
client ( string | integer $alias ) : Credis_Client | Get a client by index or alias. | |
clients ( ) : array | Credis_Client[] | Get an array of all clients | |
hash ( string $key ) : integer | Get client index for a key by searching ring with binary search | |
isReadOnlyCommand ( $command ) | ||
select ( integer $index ) : void | ||
setMasterClient ( Credis_Client $masterClient, boolean $writeOnly = false ) : Credis_Cluster |
public setMasterClient ( Credis_Client $masterClient, boolean $writeOnly = false ) : Credis_Cluster | ||
$masterClient | Credis_Client | |
$writeOnly | boolean | |
return | Credis_Cluster |
protected array $aliases | ||
return | array |
protected Credis_Client[] $clients | ||
return | Credis_Client[] |
protected array $dont_hash | ||
return | array |
protected Credis_Client $masterClient | ||
return | Credis_Client |
protected array $nodes | ||
return | array |
protected int $selectedDb | ||
return | integer |