devmadhuu commented on code in PR #9994:
URL: https://github.com/apache/ozone/pull/9994#discussion_r3135697305
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -450,6 +458,65 @@ private Response getUnhealthyContainersFromSchema(
return Response.ok(response).build();
}
+ /**
+ * Export all unhealthy containers into a CSV file by streaming the results
directly
+ * from the database without holding them in the JVM heap.
+ *
+ * @param state The container state to filter by, or null for all.
+ * @param limit The maximum number of records to return, 0 for unlimited.
+ * @return {@link Response} containing the CSV StreamingOutput.
+ */
+ @GET
+ @Path("/unhealthy/export")
+ @Produces("text/csv")
+ public Response exportUnhealthyContainers(
+ @QueryParam("state") String state,
+ @DefaultValue("0") @QueryParam(RECON_QUERY_LIMIT) int limit) {
Review Comment:
Even 5M is nothing and we can see for 5M it has increased to 9.4 secs. IN
large clusters, we have seen upto 300M containers and no limit and will
continue to grow, by this logic, 300M will take upto 9.4 mins, It is not a good
user experience where user needs to wait in browser for download. This may
even continue to grow. I would still suggest to improve user experience and
think from scalability point of view. Also this 9.4 min will be like happy
scenario. Imagine if network is bad or some other issue, it can continue to
timeout or user waits indefinitely. So in such scenarios, best industry
practice is to make an async call, let UI keep polling the status and make it
available for user to download.
--
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]