PHP 클래스 Basho\Riak

$nodes = (new Node\Builder) ->atHost('localhost') ->onPort(8098) ->build() $riak = new Riak($nodes); $command = (new Command\Builder\FetchObject($riak)) ->buildLocation('username', 'users') ->build(); $response = $command->execute(); $user = $response->getObject();
파일 보기 프로젝트 열기: basho/riak-php-client 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$activeNodeIndex integer The actively connected Riak Node from the ring
$api Basho\Riak\Api | null API Bridge class to use
$attempts integer Connection attempts made that failed
$config array Configuration options for this client
$inactiveNodes array List of nodes marked inactive
$nodes Basho\Riak\Node[] Riak server ring

공개 메소드들

메소드 설명
__construct ( array $nodes, array $config = [], Basho\Riak\Api $api = NULL ) Construct a new Client object, defaults to port 8098.
execute ( Basho\Riak\Command $command ) : Basho\Riak\Command\Response Execute a Riak command
getActiveNode ( ) : Node
getActiveNodeIndex ( ) : integer
getApi ( ) : Basho\Riak\Api | null
getConfig ( ) : array
getConfigValue ( $key ) : mixed Get value from connection config
getLastRequest ( ) : string Accessor for the last request issued to the API. For debugging purposes.
getNodes ( ) : Node[]
pickNewNode ( ) Pick new active node
setActiveNodeIndex ( integer $activeNodeIndex )

보호된 메소드들

메소드 설명
pickNode ( ) : integer Pick a random Node from the ring

메소드 상세

__construct() 공개 메소드

Construct a new Client object, defaults to port 8098.
public __construct ( array $nodes, array $config = [], Basho\Riak\Api $api = NULL )
$nodes array an array of Basho\Riak\Node objects
$config array a configuration object
$api Basho\Riak\Api

execute() 공개 메소드

Execute a Riak command
public execute ( Basho\Riak\Command $command ) : Basho\Riak\Command\Response
$command Basho\Riak\Command
리턴 Basho\Riak\Command\Response

getActiveNode() 공개 메소드

public getActiveNode ( ) : Node
리턴 Basho\Riak\Node

getActiveNodeIndex() 공개 메소드

public getActiveNodeIndex ( ) : integer
리턴 integer

getApi() 공개 메소드

public getApi ( ) : Basho\Riak\Api | null
리턴 Basho\Riak\Api | null

getConfig() 공개 메소드

public getConfig ( ) : array
리턴 array

getConfigValue() 공개 메소드

Get value from connection config
public getConfigValue ( $key ) : mixed
$key
리턴 mixed

getLastRequest() 공개 메소드

Accessor for the last request issued to the API. For debugging purposes.
public getLastRequest ( ) : string
리턴 string

getNodes() 공개 메소드

public getNodes ( ) : Node[]
리턴 Basho\Riak\Node[]

pickNewNode() 공개 메소드

Used when the currently active node fails to complete a command / query
public pickNewNode ( )

pickNode() 보호된 메소드

You can pick your friends, you can pick your node, but you can't pick your friend's node. :)
protected pickNode ( ) : integer
리턴 integer

setActiveNodeIndex() 공개 메소드

public setActiveNodeIndex ( integer $activeNodeIndex )
$activeNodeIndex integer

프로퍼티 상세

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

The actively connected Riak Node from the ring
protected int $activeNodeIndex
리턴 integer

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

API Bridge class to use
protected Api,Basho\Riak|null $api
리턴 Basho\Riak\Api | null

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

Connection attempts made that failed
protected int $attempts
리턴 integer

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

Configuration options for this client
protected array $config
리턴 array

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

List of nodes marked inactive
protected array $inactiveNodes
리턴 array

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

Riak server ring
protected Node[],Basho\Riak $nodes
리턴 Basho\Riak\Node[]