PHP 클래스 Predis\Connection\Aggregate\MasterSlaveReplication

저자: Daniele Alessandri ([email protected])
상속: implements Predis\Connection\Aggregate\ReplicationInterface
파일 보기 프로젝트 열기: tillkruss/redis-object-cache 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$autoDiscovery boolean
$connectionFactory Predis\Connection\FactoryInterface
$current Predis\Connection\NodeConnectionInterface
$master Predis\Connection\NodeConnectionInterface
$slaves Predis\Connection\NodeConnectionInterface[]
$strategy Predis\Replication\ReplicationStrategy

공개 메소드들

메소드 설명
__construct ( ReplicationStrategy $strategy = null )
__sleep ( )
add ( Predis\Connection\NodeConnectionInterface $connection )
connect ( )
disconnect ( )
discover ( ) Fetches the replication configuration from one of the servers.
executeCommand ( Predis\Command\CommandInterface $command )
getConnection ( Predis\Command\CommandInterface $command )
getConnectionById ( $connectionId )
getCurrent ( )
getMaster ( )
getReplicationStrategy ( ) : ReplicationStrategy Returns the underlying replication strategy.
getSlaves ( )
isConnected ( )
readResponse ( Predis\Command\CommandInterface $command )
remove ( Predis\Connection\NodeConnectionInterface $connection )
setAutoDiscovery ( boolean $value ) Configures the automatic discovery of the replication configuration on failure.
setConnectionFactory ( Predis\Connection\FactoryInterface $connectionFactory ) Sets the connection factory used to create the connections by the auto discovery procedure.
switchTo ( $connection )
switchToMaster ( ) Switches to the master server.
switchToSlave ( ) Switches to a random slave server.
writeRequest ( Predis\Command\CommandInterface $command )

보호된 메소드들

메소드 설명
discoverFromMaster ( Predis\Connection\NodeConnectionInterface $connection, Predis\Connection\FactoryInterface $connectionFactory ) Discovers the replication configuration by contacting the master node.
discoverFromSlave ( Predis\Connection\NodeConnectionInterface $connection, Predis\Connection\FactoryInterface $connectionFactory ) Discovers the replication configuration by contacting one of the slaves.
pickSlave ( ) : Predis\Connection\NodeConnectionInterface Returns a random slave.
reset ( ) Resets the connection state.

비공개 메소드들

메소드 설명
getMasterOrDie ( ) : Predis\Connection\NodeConnectionInterface Returns the connection associated to the master server.
handleInfoResponse ( string $response ) : array Handles response from INFO.
retryCommandOnFailure ( Predis\Command\CommandInterface $command, string $method ) : mixed Retries the execution of a command upon slave failure.

메소드 상세

__construct() 공개 메소드

public __construct ( ReplicationStrategy $strategy = null )
$strategy Predis\Replication\ReplicationStrategy

__sleep() 공개 메소드

public __sleep ( )

add() 공개 메소드

public add ( Predis\Connection\NodeConnectionInterface $connection )
$connection Predis\Connection\NodeConnectionInterface

connect() 공개 메소드

public connect ( )

disconnect() 공개 메소드

public disconnect ( )

discover() 공개 메소드

Fetches the replication configuration from one of the servers.
public discover ( )

discoverFromMaster() 보호된 메소드

Discovers the replication configuration by contacting the master node.
protected discoverFromMaster ( Predis\Connection\NodeConnectionInterface $connection, Predis\Connection\FactoryInterface $connectionFactory )
$connection Predis\Connection\NodeConnectionInterface Connection to the master node.
$connectionFactory Predis\Connection\FactoryInterface Connection factory instance.

discoverFromSlave() 보호된 메소드

Discovers the replication configuration by contacting one of the slaves.
protected discoverFromSlave ( Predis\Connection\NodeConnectionInterface $connection, Predis\Connection\FactoryInterface $connectionFactory )
$connection Predis\Connection\NodeConnectionInterface Connection to one of the slaves.
$connectionFactory Predis\Connection\FactoryInterface Connection factory instance.

executeCommand() 공개 메소드

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

getConnection() 공개 메소드

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

getConnectionById() 공개 메소드

public getConnectionById ( $connectionId )

getCurrent() 공개 메소드

public getCurrent ( )

getMaster() 공개 메소드

public getMaster ( )

getReplicationStrategy() 공개 메소드

Returns the underlying replication strategy.
public getReplicationStrategy ( ) : ReplicationStrategy
리턴 Predis\Replication\ReplicationStrategy

getSlaves() 공개 메소드

public getSlaves ( )

isConnected() 공개 메소드

public isConnected ( )

pickSlave() 보호된 메소드

Returns a random slave.
protected pickSlave ( ) : Predis\Connection\NodeConnectionInterface
리턴 Predis\Connection\NodeConnectionInterface

readResponse() 공개 메소드

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

remove() 공개 메소드

public remove ( Predis\Connection\NodeConnectionInterface $connection )
$connection Predis\Connection\NodeConnectionInterface

reset() 보호된 메소드

Resets the connection state.
protected reset ( )

setAutoDiscovery() 공개 메소드

Configures the automatic discovery of the replication configuration on failure.
public setAutoDiscovery ( boolean $value )
$value boolean Enable or disable auto discovery.

setConnectionFactory() 공개 메소드

Sets the connection factory used to create the connections by the auto discovery procedure.
public setConnectionFactory ( Predis\Connection\FactoryInterface $connectionFactory )
$connectionFactory Predis\Connection\FactoryInterface Connection factory instance.

switchTo() 공개 메소드

public switchTo ( $connection )

switchToMaster() 공개 메소드

Switches to the master server.
public switchToMaster ( )

switchToSlave() 공개 메소드

Switches to a random slave server.
public switchToSlave ( )

writeRequest() 공개 메소드

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

프로퍼티 상세

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

protected bool $autoDiscovery
리턴 boolean

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

protected FactoryInterface,Predis\Connection $connectionFactory
리턴 Predis\Connection\FactoryInterface

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

protected NodeConnectionInterface,Predis\Connection $current
리턴 Predis\Connection\NodeConnectionInterface

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

protected NodeConnectionInterface,Predis\Connection $master
리턴 Predis\Connection\NodeConnectionInterface

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

protected NodeConnectionInterface[],Predis\Connection $slaves
리턴 Predis\Connection\NodeConnectionInterface[]

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

protected ReplicationStrategy,Predis\Replication $strategy
리턴 Predis\Replication\ReplicationStrategy