You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/07/27 14:04:41 UTC
[GitHub] [ozone] dombizita commented on a diff in pull request #3622: HDDS-7050. Recon "/missing" endpoint return limit too high
dombizita commented on code in PR #3622:
URL: https://github.com/apache/ozone/pull/3622#discussion_r931105828
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -237,14 +237,18 @@ public Response getReplicaHistoryForContainer(
* {@link org.apache.hadoop.ozone.recon.api.types.MissingContainerMetadata}
* for all missing containers.
*
+ * @param limit The limit of missing containers to return.
* @return {@link Response}
*/
@GET
@Path("/missing")
- public Response getMissingContainers() {
+ public Response getMissingContainers(
+ @DefaultValue(DEFAULT_FETCH_COUNT) @QueryParam(RECON_QUERY_LIMIT)
+ int limit
+ ) {
List<MissingContainerMetadata> missingContainers = new ArrayList<>();
containerHealthSchemaManager.getUnhealthyContainers(
- UnHealthyContainerStates.MISSING, 0, Integer.MAX_VALUE)
+ UnHealthyContainerStates.MISSING, 0, limit)
Review Comment:
It will go from older to limit in my belief. As the `getUnhealthyContainers` is creating a `SelectQuery` where the offset is 0 and the limit is set by the limit variable. So it adds a 0-based OFFSET clause to the query and it will limit the results of this select. The age of the unhealthy container counts from the `inStateSince` variable or when was it inserted into the DB via the `insertUnhealthyContainerRecords` method?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org