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

implement the start/limit efficiently #71

Closed
tloubrieu-jpl opened this issue Feb 24, 2021 · 1 comment
Closed

implement the start/limit efficiently #71

tloubrieu-jpl opened this issue Feb 24, 2021 · 1 comment
Assignees
Labels

Comments

@tloubrieu-jpl
Copy link
Member

All end-point need the pagination implementation except the urn resolvers.

This need to be implemented efficiently so that we don't go through the same items if a sequence of requests is:

collections?start=0&limit=10
collections?start=11&limit=10
...

One way of doing that is using java stream.skip() method.

Acceptance criteria:
For requests with numerous results, the processing time for any page is the same for any page (e.g. it does not become longer when the start number is bigger). This can be tested on the demo deployment https://pds-gamma.jpl.nasa.gov/api/swagger-ui.html of the reference implementation (https://github.com/NASA-PDS/registry-api-service).

Request examples:
curl --location --request GET 'https://pds-gamma.jpl.nasa.gov/api/products?start=1&limit=500'

curl --location --request GET 'https://pds-gamma.jpl.nasa.gov/api/collections/urn:nasa:pds:orex.ovirs:data_calibrated::10.0/products?start=100&limit=100'

Replace start and limit with your values.

@tloubrieu-jpl
Copy link
Member Author

imported, see original ticket NASA-PDS/registry-api-service#3

@tloubrieu-jpl tloubrieu-jpl self-assigned this Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant