symious commented on code in PR #4800:
URL: https://github.com/apache/ozone/pull/4800#discussion_r1217368336


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -175,13 +175,19 @@ public BackgroundTaskQueue getTasks() {
   public List<ContainerBlockInfo> chooseContainerForBlockDeletion(
       int blockLimit, ContainerDeletionChoosingPolicy deletionPolicy)
       throws StorageContainerException {
+    long[] totalPendingBlockCount = new long[1];
     Map<Long, ContainerData> containerDataMap =
         ozoneContainer.getContainerSet().getContainerMap().entrySet().stream()
             .filter(e -> ((KeyValueContainerData) e.getValue()
                 .getContainerData()).getNumPendingDeletionBlocks() > 0)
             .filter(e -> isDeletionAllowed(e.getValue().getContainerData(),
-                deletionPolicy)).collect(Collectors
+                deletionPolicy))
+            .peek(e -> totalPendingBlockCount[0] +=

Review Comment:
   I'm not sure `peek` is good to use here.
   
   An explicit sum on the result map might be better.



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