adoroszlai commented on code in PR #8644:
URL: https://github.com/apache/ozone/pull/8644#discussion_r2153737324


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/StreamDataChannelBase.java:
##########
@@ -93,6 +94,14 @@ public final boolean isOpen() {
     return getChannel().isOpen();
   }
 
+  protected void assertSpaceAvailability() throws IOException {
+    if (containerData.getVolume().isVolumeFull()) {
+      throw new StorageContainerException("write failed for container " + 
containerData.getContainerID()
+          + " due to volume " + containerData.getVolume().getStorageID() + " 
out of space "
+          + containerData.getVolume().getCurrentUsage(), DISK_OUT_OF_SPACE);

Review Comment:
   - Please move method to `HddsVolume` as `assertSpaceForWrite`.
   - Accept required size in parameter, as @szetszwo 
[mentioned](https://github.com/apache/ozone/pull/8644/files#r2153308528).
   - In the implementation, add local variables for the values (`currentUsage`, 
`minFreeSpace`), and use them in both calculation and log message.  Do not call 
`boolean isVolumeFull()`, because then the message needs to obtain the same 
values again.



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