PHP 클래스 Credis_Cluster

사용 중단:
파일 보기 프로젝트 열기: colinmollenhour/credis 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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

메소드 상세

__call() 공개 메소드

Execute a Redis command on the cluster with automatic consistent hashing and read/write splitting
public __call ( string $name, array $args ) : mixed
$name string
$args array
리턴 mixed

__construct() 공개 메소드

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 )
public __construct ( array $servers, integer $replicas = 128, boolean $standAlone = false )
$servers array The Redis servers in the cluster.
$replicas integer
$standAlone boolean

all() 공개 메소드

Execute a command on all clients
public all ( ) : array
리턴 array

byHash() 공개 메소드

Get the client that the key would hash to.
public byHash ( string $key ) : Credis_Client
$key string
리턴 Credis_Client

client() 공개 메소드

Get a client by index or alias.
public client ( string | integer $alias ) : Credis_Client
$alias string | integer
리턴 Credis_Client

clients() 공개 메소드

Get an array of all clients
public clients ( ) : array | Credis_Client[]
리턴 array | Credis_Client[]

hash() 공개 메소드

Get client index for a key by searching ring with binary search
public hash ( string $key ) : integer
$key string The key to hash
리턴 integer The index of the client object associated with the hash of the key

isReadOnlyCommand() 공개 메소드

public isReadOnlyCommand ( $command )

select() 공개 메소드

public select ( integer $index ) : void
$index integer
리턴 void

setMasterClient() 공개 메소드

public setMasterClient ( Credis_Client $masterClient, boolean $writeOnly = false ) : Credis_Cluster
$masterClient Credis_Client
$writeOnly boolean
리턴 Credis_Cluster

프로퍼티 상세

$aliases 보호되어 있는 프로퍼티

Aliases of Credis_Client objects attached to Redis servers, used to route commands to specific servers
또한 보기: Credis_Cluster::to
protected array $aliases
리턴 array

$clients 보호되어 있는 프로퍼티

Collection of Credis_Client objects attached to Redis servers
protected Credis_Client[] $clients
리턴 Credis_Client[]

$dont_hash 보호되어 있는 프로퍼티

The commands that are not subject to hashing
protected array $dont_hash
리턴 array

$masterClient 보호되어 있는 프로퍼티

If a server is set as master, all write commands go to that one
protected Credis_Client $masterClient
리턴 Credis_Client

$nodes 보호되어 있는 프로퍼티

Individual nodes of pointers to Redis servers on the hash ring
protected array $nodes
리턴 array

$ring 보호되어 있는 프로퍼티

Hash ring of Redis server nodes
protected array $ring
리턴 array

$selectedDb 보호되어 있는 프로퍼티

Currently working cluster-wide database number.
protected int $selectedDb
리턴 integer