PHP Class 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();
Afficher le fichier Open project: basho/riak-php-client Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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 )

Méthodes protégées

Méthode Description
pickNode ( ) : integer Pick a random Node from the ring

Method Details

__construct() public méthode

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() public méthode

Execute a Riak command
public execute ( Basho\Riak\Command $command ) : Basho\Riak\Command\Response
$command Basho\Riak\Command
Résultat Basho\Riak\Command\Response

getActiveNode() public méthode

public getActiveNode ( ) : Node
Résultat Basho\Riak\Node

getActiveNodeIndex() public méthode

public getActiveNodeIndex ( ) : integer
Résultat integer

getApi() public méthode

public getApi ( ) : Basho\Riak\Api | null
Résultat Basho\Riak\Api | null

getConfig() public méthode

public getConfig ( ) : array
Résultat array

getConfigValue() public méthode

Get value from connection config
public getConfigValue ( $key ) : mixed
$key
Résultat mixed

getLastRequest() public méthode

Accessor for the last request issued to the API. For debugging purposes.
public getLastRequest ( ) : string
Résultat string

getNodes() public méthode

public getNodes ( ) : Node[]
Résultat Basho\Riak\Node[]

pickNewNode() public méthode

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

pickNode() protected méthode

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

setActiveNodeIndex() public méthode

public setActiveNodeIndex ( integer $activeNodeIndex )
$activeNodeIndex integer

Property Details

$activeNodeIndex protected_oe property

The actively connected Riak Node from the ring
protected int $activeNodeIndex
Résultat integer

$api protected_oe property

API Bridge class to use
protected Api,Basho\Riak|null $api
Résultat Basho\Riak\Api | null

$attempts protected_oe property

Connection attempts made that failed
protected int $attempts
Résultat integer

$config protected_oe property

Configuration options for this client
protected array $config
Résultat array

$inactiveNodes protected_oe property

List of nodes marked inactive
protected array $inactiveNodes
Résultat array

$nodes protected_oe property

Riak server ring
protected Node[],Basho\Riak $nodes
Résultat Basho\Riak\Node[]