google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

Expose page token to caller for ListObjects API

Open harshitkr12 opened this issue 7 months ago • 0 comments

What component of google-cloud-cpp is this feature request for?

google/cloud/storage/client.h

Is your feature request related to a problem? Please describe. Currently ListObjects returns an iterator which can be used to go through all the object metadata using single API call. But in case the process that was fetching crashed, I need to resume efficiently right from where it left off for a particular prefix. As in I don't want to start the iterator from the beginning for that prefix. If we can add functionality using page token(as other cloud provider like AWS exposes) to efficiently resume starting from the page where the process crashed, then that will prevent us from re-fetching from beginning.

Describe the solution you'd like

Some sort of pagination or efficient seeking mechanism to resume from the process left off.

Describe alternatives you've considered

I have not leveraged [startOffset] option but given the object's are listed in lexicographical order of their name, can it be used for efficiently resuming from where the process left off if I pass the last fetched key just before the crash as startOffset to a new ListObjects iterator ? Is this seek to the startOffset when passed in the ListObjects API done in O(1)?

Additional context

harshitkr12 avatar Jun 20 '25 18:06 harshitkr12