$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();
Mostrar archivo
Open project: basho/riak-php-client
Class Usage Examples
Property | 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 | Riak server ring |
Method | 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 ( ) : |
||
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 ( ) : |
||
pickNewNode ( ) | Pick new active node | |
setActiveNodeIndex ( integer $activeNodeIndex ) |
Method | Description | |
---|---|---|
pickNode ( ) : integer | Pick a random Node from the ring |
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 |
public execute ( Basho\Riak\Command $command ) : Basho\Riak\Command\Response | ||
$command | Basho\Riak\Command | |
return | Basho\Riak\Command\Response |
public getConfigValue ( $key ) : mixed | ||
$key | ||
return | mixed |
public getLastRequest ( ) : string | ||
return | string |
public pickNewNode ( ) |
public setActiveNodeIndex ( integer $activeNodeIndex ) | ||
$activeNodeIndex | integer |
protected int $activeNodeIndex | ||
return | integer |
protected Api,Basho\Riak|null $api | ||
return | Basho\Riak\Api | null |
protected int $attempts | ||
return | integer |
protected array $config | ||
return | array |
protected array $inactiveNodes | ||
return | array |