You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/22 18:47:33 UTC

[GitHub] [ozone] aswinshakil commented on a diff in pull request #3655: HDDS-7091. Filter containers with pending deletion blocks before checking policy

aswinshakil commented on code in PR #3655:
URL: https://github.com/apache/ozone/pull/3655#discussion_r951790063


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -180,6 +180,8 @@ public List<ContainerBlockInfo> chooseContainerForBlockDeletion(
       throws StorageContainerException {
     Map<Long, ContainerData> containerDataMap =
         ozoneContainer.getContainerSet().getContainerMap().entrySet().stream()
+            .filter(e -> ((KeyValueContainerData) e.getValue()
+                .getContainerData()).getNumPendingDeletionBlocks() > 0)

Review Comment:
   Since we are already filtering ContainerData based on the pending block deletes. We should refactor the code to not check again for `entry.getNumPendingDeletionBlocks() > 0`
   
   https://github.com/apache/ozone/blob/8d331a371fca43f5f7a4cf027f227f237388dc46/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/TopNOrderedContainerDeletionChoosingPolicy.java#L76-L83



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org