umesh9794 commented on code in PR #10549:
URL: https://github.com/apache/ozone/pull/10549#discussion_r3542750740


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/persistence/ContainerHealthSchemaManager.java:
##########
@@ -227,6 +291,43 @@ private int deleteScmStatesForContainers(DSLContext 
dslContext,
     return totalDeleted;
   }
 
+  private void deleteStaleUnhealthyRecords(DSLContext dslContext,
+      List<ContainerStateKey> staleKeys) {
+    if (staleKeys.isEmpty()) {
+      return;
+    }
+    for (ContainerStateKey key : staleKeys) {
+      dslContext.deleteFrom(UNHEALTHY_CONTAINERS)
+          .where(UNHEALTHY_CONTAINERS.CONTAINER_ID.eq(key.getContainerId()))
+          
.and(UNHEALTHY_CONTAINERS.CONTAINER_STATE.eq(key.getContainerState()))
+          .execute();
+    }
+  }
+
+  private void batchUpdateInChunks(DSLContext dslContext,
+      List<UnhealthyContainerRecord> recs) {
+    if (recs.isEmpty()) {
+      return;
+    }
+    for (int from = 0; from < recs.size(); from += BATCH_INSERT_CHUNK_SIZE) {

Review Comment:
   Good catch. Yes, batch update are missing, it only does batching for inserts 
as of now. Let me cover the batching in updated and deletes too. 



-- 
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]

Reply via email to