sumitagrawl commented on code in PR #7981:
URL: https://github.com/apache/ozone/pull/7981#discussion_r1985994926


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -84,6 +84,8 @@ public class HddsVolume extends StorageVolume {
 
   private final AtomicLong committedBytes = new AtomicLong(); // till Open 
containers become full
 
+  private final AtomicLong containerImportCommittedBytes = new AtomicLong();

Review Comment:
   can remove containerImportCommittedBytes member variable also.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SendContainerRequestHandler.java:
##########
@@ -85,6 +90,22 @@ public void onNext(SendContainerRequest req) {
       if (containerId == -1) {
         containerId = req.getContainerID();
         volume = importer.chooseNextVolume();
+        // Increment committed bytes and verify if it doesn't cross the space 
left.
+        volume.incCommittedBytes(importer.getDefaultContainerSize() * 2);
+        // Already committed bytes increased above, so required space is not 
required here in AvailableSpaceFilter
+        AvailableSpaceFilter filter = new AvailableSpaceFilter(0);
+        List<HddsVolume> hddsVolumeList = new ArrayList<>();
+        hddsVolumeList.add(volume);
+        List<HddsVolume> volumeWithEnoughSpace = hddsVolumeList.stream()
+            .filter(filter)
+            .collect(Collectors.toList());
+        if (volumeWithEnoughSpace.isEmpty()) {

Review Comment:
   If volume is choosen, no meaning of filtering here. we can have method -- 
chooseNextVolume() which will also occupy the space And - releaseVolume() that 
will do remove of committed bytes.



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