Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a pagination interface so that you can generically handle paginated responses #1074

Closed
gorzell opened this issue Mar 20, 2017 · 4 comments
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@gorzell
Copy link

gorzell commented Mar 20, 2017

I am re-opening #121 since the alternate solution seems like it was never completed and is not maintained.

It would be really help to have interfaces around the pagination of results. This would give you the ability to write generic logic for loading the full data set.

I propose declaring interfaces which would probably only need to have the getNextToken and setNextToken methods respectively and then changing the Request/Result model classes that have these methods already to implement the interfaces.

I am happy to do the code change if people think this would be useful and is the correct approach.

@shorea
Copy link
Contributor

shorea commented Mar 20, 2017

We are working on V2 of the SDK and one of the goals is to provide a consistent pagination experience and make automatic pagination a first class citizen of the SDK. If you are interested in participating in the developer preview we can reach out to you later this year.

@varunnvs92 varunnvs92 added the feature-request A feature should be added or improved. label Mar 20, 2017
@dagnir dagnir self-assigned this Mar 20, 2017
@gorzell
Copy link
Author

gorzell commented Jan 25, 2018

Any updates on this? Is it in the new version?

@millems
Copy link
Contributor

millems commented Jan 25, 2018

Yes! This is currently available in V2 for our sync clients (aws/aws-sdk-java-v2#26). If you add Iterable to the end of the method name on a client, you get to the automated-depaginating result type:

ListObjectsV2Paginator result = s3Client.listObjectsV2Iterable(request);

Iterable<ListObjectsV2Response> resultPages = result;
Stream<ListObjectsV2Response> resultPagesStream = result.stream();

Iterable<S3Object> results = result.contents();
Stream<S3Object> resultsStream = result.contents().stream();

Please let us know what you think!

@debora-ito
Copy link
Member

Hi @gorzell, since the SDK team is concentrating efforts on V2 new features and pagination is already available in V2, they decided to not implement this one in V1. I'll go ahead and close this one.

Please feel free to reach out if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

6 participants