question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST] Add listing overload to accept continuation token

See original GitHub issue

Query/Question I’m upgrading the storage SDK in my application from v8 to v12. In v8, there is a list blobs API which accepts a continuation token and gets the next page of blobs. However, in v12, I could not find a similar API and either I need to always get the first page of blobs and use the response iterable to list using the continuation token (as shown below) or preserve the response object to avoid listing the first page every time. Is there a better way? With the first approach, I’m making unnecessary requests and with the second one, I cannot preserve state and resume processing of blobs from where I left off or continue processing on a different machine.

PagedIterable<BlobItem> response = containerClient.listBlobs();
Iterable<PagedResponse<BlobItem>> desiredPage = response.iterableByPage(continuationToken);

Why is this not a Bug or a feature Request? NA

Setup (please complete the following information if applicable):

  • OS: Linux
  • IDE : IntelliJ
  • Version of the Library used: 12.0.0

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rickle-msftcommented, Nov 23, 2019

We caught it while looking into the behavior as a part of this thread, so thanks for starting easy on us 😃

I’m not sure this will make into the next release, but I will prioritize investigating this overload and stay on top of the eager iterator behavior and keep you updated.

0reactions
SukruthKScommented, Nov 22, 2019

While they say it is lazy, we are noticing that it only seems to be lazy insofar as waiting to call next to start, and after that it will eagerly fetch until the end of the stream, which means this iterable will try to eagerly list all your blobs, and that will be a problem. This is being tracked in #6518, and we are discussing a different implementation that will also lazy fetch as well as lazily subscribe.

Good that you caught this! It was definitely going to be an issue for us as some of the containers we list can contain a very large number of blobs.

I also hear what you’re saying about the overload to accept the continuation token rather than passing it into the return type. With your permission, I’d like to rename this issue to track adding the overload and allow #6518 to track the iterator behavior.

Sure, please go ahead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination and iteration in the Azure SDK for Java
This API also has a continuation token overload for returning to the same point of iteration at a later time. Java Copy. client.listSecrets()...
Read more >
Unable to use continuation token for listing user entitlements
in a license management solution. This by default returns 100 users, and a value for $top can be provided. But there seems to...
Read more >
API pagination best practices - Stack Overflow
To handle the mentioned drawbacks of the normal keyset pagination, you can add an offset to the timestamp and use a so-called "Continuation...
Read more >
Usage - RestSharp
Add default parameters of any kind (not just headers) to the client, once; Add parameters of any kind to each request (query, URL...
Read more >
Java Azure SDK Design Guidelines
A paginated sync list API (refer to pagination section for more details) public ... byPage() offers an overload to accept a continuationToken string, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found