kerneltime commented on code in PR #4158:
URL: https://github.com/apache/ozone/pull/4158#discussion_r1083653560
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -112,21 +117,29 @@ public Response getContainers(
int limit,
@DefaultValue(PREV_CONTAINER_ID_DEFAULT_VALUE)
@QueryParam(RECON_QUERY_PREVKEY) long prevKey) {
- Map<Long, ContainerMetadata> containersMap;
- long containersCount;
- try {
- containersMap =
- reconContainerMetadataManager.getContainers(limit, prevKey);
- containersCount = reconContainerMetadataManager.getCountForContainers();
- } catch (IOException ioEx) {
- throw new WebApplicationException(ioEx,
- Response.Status.INTERNAL_SERVER_ERROR);
+ if (limit < 0 || prevKey < 0) {
+ // Send back an empty response
+ return Response.ok().build();
Review Comment:
Should the return here be something other than `ok` maybe `notAcceptable`?
--
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]