basho/riak-php-client

Stream keys in getAllKeys() (and possibly 2i)

Closed this issue · 1 comments

The current implementation of list keys does not stream the result, making Riak angry if there are more than a couple of thousand keys.

The following code allows for streaming keys using another curl writefunction.
I'll gladly make a pull request if you guys want it in the official repo ShareMyWorld@9806020

Testing the operation on a bucket containing 100000 keys gives the following result on m1.small EC2 instance, running php 5.4, Riak 1.3.2 with leveldb:

Num keys: 100000
Execution time: 11.900022983551 s
PHP Memory peak usage: 19.75 MB

indexSearch() could also easily be modified to use the same curl write function to allow streaming of index searches though it might not be necessary now that there is pagination support in Riak.

Hey Andreas, I am not going to adjust the old client, but this is something I can implement within the rewritten client that we are releasing in the next few days. For now, since this is so old, I am going to close it. If this is a feature you would like in the new client, please just reopen this ticket and I will get it queued up.