Select all bucket keys with Java SDK

Hi,

What is the most effective way of retrieving entire bucket’s key set in Java?
Is there any streaming API available?
Is it possible to parallelize the query?
How to avoid deep pagination issue?

Thanks,
Igor Sandler

CREATE PRIMARY INDEX ON default;
SELECT RAW META().id FROM default;

To avoid deep pagination follow based on above index and query following approach https://blog.couchbase.com/offset-keyset-pagination-n1ql-query-couchbase/