devmadhuu commented on code in PR #7517:
URL: https://github.com/apache/ozone/pull/7517#discussion_r1916961934
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerSizeCountTask.java:
##########
@@ -168,8 +161,29 @@ private void process(ContainerInfo container,
* size counts. Finally, the counts in the containerSizeCountMap are written
* to the database using the writeCountsToDB() function.
*/
- public void process(List<ContainerInfo> containers) {
+ @Override
+ protected void runTask() {
+ final List<ContainerInfo> containers = containerManager.getContainers();
+ if (processedContainers.isEmpty()) {
+ try {
+ int execute =
+ dslContext.truncate(CONTAINER_COUNT_BY_SIZE).execute();
+ LOG.debug("Deleted {} records from {}", execute,
+ CONTAINER_COUNT_BY_SIZE);
+ } catch (Exception e) {
+ LOG.error("An error occurred while truncating the table {}: {}",
+ CONTAINER_COUNT_BY_SIZE, e.getMessage(), e);
+ return;
Review Comment:
We should not catch here, I know it is old code, but since we are adding
metrics and handling error status for each task, this should propagate the
error as it is, so remove the try catch for above code. cc: @ArafatKhan2198
--
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]