[
https://issues.apache.org/jira/browse/HDDS-9725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17812386#comment-17812386
]
smita commented on HDDS-9725:
-----------------------------
As per Zita Suggestion
I started to look into this pagination problem, where we can pass the previous
key and the limit to the requests. Do any of us know why are we passing the
{{prevKey}} not the {{{}offset{}}}? I looked into examples on the internet, how
are they handling this case and I found that at most places they are passing
the {{limit}} and the {{offset}} to the requests. With that it would be easier,
as the offset can be calculated easily with the page and the limit, so we won’t
need any other structure in the code to get which keys do we need.
Examples I found: *
[https://support.smartbear.com/qacomplete/docs/developer/api/rest/api/reference/paging.html]
* [https://developer.digitalchalk.com/document/rest-api-v5/limit-and-offset/]
*
[https://stackoverflow.com/questions/53125088/paginated-rest-api-how-to-select-amount-of-data-returned]:
If it's an open API (used by clients you don't control), then let clients
control what size paging they want. Rather than support a pageNumber parameter,
support offset and limit. Offset is how many records to skip before starting to
return records, and limit is the maximum number of records to return. If the
client is not happy with how their request performs, they can adjust the
parameters to suit their needs.
I did a quick check and I think it won’t be a big change from the backend, this
is one relevant code I think:
[https://github.com/apache/ozone/blob/ff7bab0d28a25dcea216e91154e69e60275f2b0b/hado[…]n/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java|https://github.com/apache/ozone/blob/ff7bab0d28a25dcea216e91154e69e60275f2b0b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java#L589-L604]
> Recon - OpenKeys Pagination Issue and Search Functionality Issue
> ----------------------------------------------------------------
>
> Key: HDDS-9725
> URL: https://issues.apache.org/jira/browse/HDDS-9725
> Project: Apache Ozone
> Issue Type: Bug
> Reporter: smita
> Assignee: smita
> Priority: Major
> Labels: pull-request-available
>
> Open keys paginations seems not correct on UI:
> 1) Seacch Functionality was not working Properly.
> 2) Getting Duplicate records.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]