Shimon Benattar
Shimon Benattar

Reputation: 173

Paging get all keys on riak with Java Api

we are currently testing out Riak, we have in Riak a huge bucket with millions of keys and I need to query all the keys and save them in a file. We are using Java as the API.

Is there any way to get the result of the query paged?

Upvotes: 1

Views: 655

Answers (1)

Christian Dahlqvist
Christian Dahlqvist

Reputation: 1665

Listing millions of keys in Riak is not recommended in production environments as it is a very expensive operation. If you still need to do it, it is best to use the list keys function as this allows Riak to stream results back to the client and will work for any backend.

While it is possible to perform paging for secondary index queries if you are using LevelDB or the memory backend in version 1.4 onwards, this requires sorting on the server side and is therefore not recommended for such large result sets.

Upvotes: 1

Related Questions