adoroszlai commented on a change in pull request #1970:
URL: https://github.com/apache/ozone/pull/1970#discussion_r584615928



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeInfo.java
##########
@@ -83,6 +90,18 @@ public VolumeInfo build() throws IOException {
     }
   }
 
+  private long getReserved(ConfigurationSource conf) {
+    Collection<String> reserveList = conf.getTrimmedStringCollection(
+        HDDS_DATANODE_DIR_DU_RESERVED);
+    Map<String, Long> reserveMap = new HashMap<>();
+    for (String reserve : reserveList) {
+      String[] words = reserve.split(":");
+      reserveMap.put(words[0], Long.parseLong(words[1].trim()));

Review comment:
       Can you please add some validation and error handling?  A config typo 
shouldn't prevent Datanode from starting up.

##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeInfo.java
##########
@@ -83,6 +90,18 @@ public VolumeInfo build() throws IOException {
     }
   }
 
+  private long getReserved(ConfigurationSource conf) {
+    Collection<String> reserveList = conf.getTrimmedStringCollection(
+        HDDS_DATANODE_DIR_DU_RESERVED);
+    Map<String, Long> reserveMap = new HashMap<>();

Review comment:
       Nit: building the map of all directories is unnecessary, since only the 
value for `rootDir` is used.




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

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