ArafatKhan2198 commented on PR #4182: URL: https://github.com/apache/ozone/pull/4182#issuecomment-1485840652
While working on this patch, I had a doubt regarding the endpoint **`GET /api/v1/containers/:id/keys`**, which is handled by the **`getKeysForContainer()`** method in the ContainerEndpoint class. This endpoint supports two optional query parameters, **`prevKey` and `limit`**. Initially, we assumed that the **`prevKey`** parameter was used to filter the keys in a container based on a certain prefix (specified by **`prevKey`**) in their name, and only the keys with names that started with this prefix would be returned, while those that did not have this prefix would be excluded from the response. So after a discussion this is what we have understood about the `prevKey` parameter of the `ContainerEndpoint` in Recon :- - The method `getKeysForContainers()` can be used by the **RECON-UI** for pagination by making use of the "`prev-key`" query parameter and the "`limit`" parameter. - The "`prev-key`" parameter is used to specify the last key seen on the previous page. The method then retrieves all the keys starting from the key that comes after the "prev-key" parameter up to the limit specified by the "`limit`" parameter. - For example, if the UI wants to retrieve the first 10 keys in a container, it will call this method with a limit of 10 and no "prev-key" parameter. The method will then retrieve the first 10 keys in the container and return them to the UI along with the last key seen (which will be the 10th key). - If the UI wants to retrieve the next 10 keys, it will call the method again with the same limit of 10 and the "prev-key" parameter set to the last key seen on the previous page (i.e., the 10th key). The method will then retrieve the next 10 keys in the container starting from the key that comes after the 10th key and return them to the UI along with the last key seen (which will be the 20th key). - This process can be repeated for as many pages as the UI wants to retrieve. The UI can also change the limit parameter to retrieve more or fewer keys per page. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
