aryangupta1998 commented on a change in pull request #1885:
URL: https://github.com/apache/ozone/pull/1885#discussion_r592786779



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java
##########
@@ -433,23 +457,30 @@ public ContainerBackgroundTaskResult deleteViaSchema2(
       }
     }
 
-    private void deleteTransactions(List<DeletedBlocksTransaction> delBlocks,
+    private int deleteTransactions(List<DeletedBlocksTransaction> delBlocks,
         Handler handler, Table<String, BlockData> blockDataTable,
-        Container container) throws IOException {
+        Container container)
+        throws IOException {
+      int blocksDeleted = 0;
       for (DeletedBlocksTransaction entry : delBlocks) {
         for (Long blkLong : entry.getLocalIDList()) {
           String blk = blkLong.toString();
           BlockData blkInfo = blockDataTable.get(blk);
           LOG.debug("Deleting block {}", blk);
           try {
             handler.deleteBlock(container, blkInfo);
+            blocksDeleted++;
+            if (blocksDeleted == blockDeletionLimitPerInterval) {
+              return blocksDeleted;
+            }

Review comment:
       Removed

##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java
##########
@@ -398,10 +419,13 @@ public ContainerBackgroundTaskResult deleteViaSchema2(
         Handler handler = Objects.requireNonNull(ozoneContainer.getDispatcher()
             .getHandler(container.getContainerType()));
 
-        deleteTransactions(delBlocks, handler, blockDataTable, container);
+        totalBlocks =
+            deleteTransactions(delBlocks, handler, blockDataTable, container);
 
         // Once blocks are deleted... remove the blockID from blockDataTable
         // and also remove the transactions from txnTable.
+        int counter = 0;
+        int flag = 0;

Review comment:
       Removed




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

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