public function execute(RiakOperation $operation)
    {
        if (empty($this->nodes)) {
            throw new RiakException('There are no nodes in the cluster.');
        }

        $size  = count($this->nodes);
        $index = mt_rand(0, $size - 1);
        $node  = $this->nodes[$index];

        return $node->execute($operation);
    }
public function execute(RiakOperation $operation)
    {
        if (empty($this->nodes)) {
            throw new RiakException('There are no nodes in the cluster.');
        }

        $size  = count($this->nodes);
        $index = mt_rand(0, $size - 1);
        $node  = $this->nodes[$index];

        return $node->execute($operation);
    }
public function execute ( RiakOperation $ operation ) { if ( empty ( $ this -> nodes ) ) { throw new RiakException ( 'There are no nodes in the cluster.' ) ; } $ size = count ( $ this -> nodes ) ; $ index = mt_rand ( 0 , $ size - 1 ) ; $ node = $ this -> nodes [ $ index ] ; return $ node -> execute ( $ operation ) ; }
Pick a node and execute the command in this cluster

@param \Riak\Client\Core\RiakOperation $operation

@return \Riak\Client\RiakResponse
Pick a node and execute the command in this cluster