$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
Свойство | 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 |
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 ( ) : |
||
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 ) |
Méthode | 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 | |
Résultat | Basho\Riak\Command\Response |
public getConfigValue ( $key ) : mixed | ||
$key | ||
Résultat | mixed |
public getLastRequest ( ) : string | ||
Résultat | string |
public pickNewNode ( ) |
public setActiveNodeIndex ( integer $activeNodeIndex ) | ||
$activeNodeIndex | integer |
protected int $activeNodeIndex | ||
Résultat | integer |
protected Api,Basho\Riak|null $api | ||
Résultat | Basho\Riak\Api | null |
protected int $attempts | ||
Résultat | integer |
protected array $config | ||
Résultat | array |
protected array $inactiveNodes | ||
Résultat | array |