Re: [PR] HDDS-12162. Log print available space of HddsVolume upon Ozone Datanode startup [ozone]

2025-01-29 Thread via GitHub


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


##
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##
@@ -131,9 +131,11 @@ private HddsVolume(Builder b) throws IOException {
   this.volumeInfoMetrics =
   new VolumeInfoMetrics(b.getVolumeRootStr(), this);
 
-  LOG.info("Creating HddsVolume: {} of storage type : {} capacity : {}",
-  getStorageDir(), b.getStorageType(),
-  getVolumeInfo().get().getCapacity());
+  LOG.info("Creating HddsVolume: {} of storage type: {}, capacity: {}, 
available: {}",
+  getStorageDir(),
+  b.getStorageType(),
+  getVolumeInfo().get().getCapacity(),
+  getVolumeInfo().get().getAvailable());

Review Comment:
   Also, same change welcome in:
   
   
https://github.com/apache/ozone/blob/fc89ba6aef9bd01562f76ef19888a56950bc6939/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/DbVolume.java#L60-L62



-- 
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-unsubscr...@ozone.apache.org

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


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



Re: [PR] HDDS-12162. Log print available space of HddsVolume upon Ozone Datanode startup [ozone]

2025-01-29 Thread via GitHub


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


##
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##
@@ -131,9 +131,11 @@ private HddsVolume(Builder b) throws IOException {
   this.volumeInfoMetrics =
   new VolumeInfoMetrics(b.getVolumeRootStr(), this);
 
-  LOG.info("Creating HddsVolume: {} of storage type : {} capacity : {}",
-  getStorageDir(), b.getStorageType(),
-  getVolumeInfo().get().getCapacity());
+  LOG.info("Creating HddsVolume: {} of storage type: {}, capacity: {}, 
available: {}",
+  getStorageDir(),
+  b.getStorageType(),
+  getVolumeInfo().get().getCapacity(),
+  getVolumeInfo().get().getAvailable());

Review Comment:
   I would like to suggest:
   
   1. implement `toString` in `SpaceUsageSource.Fixed` like:
   ```java
   @Override
   public String toString() {
 return "capacity=" + capacity +
 "used=" + used +
 "available=" + available;
   }
   ```
   2. log usage in `HddsVolume` as:
   ```suggestion
 LOG.info("Creating HddsVolume: {} of storage type: {}, {}",
 getStorageDir(),
 b.getStorageType(),
 getCurrentUsage());
   ```



-- 
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-unsubscr...@ozone.apache.org

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


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



Re: [PR] HDDS-12162. Log print available space of HddsVolume upon Ozone Datanode startup [ozone]

2025-01-29 Thread via GitHub


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


##
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##
@@ -131,9 +131,11 @@ private HddsVolume(Builder b) throws IOException {
   this.volumeInfoMetrics =
   new VolumeInfoMetrics(b.getVolumeRootStr(), this);
 
-  LOG.info("Creating HddsVolume: {} of storage type : {} capacity : {}",
-  getStorageDir(), b.getStorageType(),
-  getVolumeInfo().get().getCapacity());
+  LOG.info("Creating HddsVolume: {} of storage type: {}, capacity: {}, 
available: {}",
+  getStorageDir(),
+  b.getStorageType(),
+  getVolumeInfo().get().getCapacity(),
+  getVolumeInfo().get().getAvailable());

Review Comment:
   I would like to suggest:
   
   1. implement `toString` in `SpaceUsageSource.Fixed` like:
   ```java
   @Override
   public String toString() {
 return "capacity: " + capacity +
 "used: " + used +
 "available: " + available;
   }
   ```
   2. log usage in `HddsVolume` as:
   ```suggestion
 LOG.info("Creating HddsVolume: {} of storage type: {}, {}",
 getStorageDir(),
 b.getStorageType(),
 getCurrentUsage());
   ```



-- 
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-unsubscr...@ozone.apache.org

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


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