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



##########
File path: 
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -703,7 +703,14 @@ public boolean mkdirs(Path f, FsPermission permission) 
throws IOException {
 
   @Override
   public long getDefaultBlockSize() {
-    return (long) getConf().getStorageSize(
+    Configuration conf = getConf();
+    ConfigurationSource source;
+    if (conf instanceof OzoneConfiguration) {
+      source = (ConfigurationSource) conf;
+    } else {
+      source = new LegacyHadoopConfigurationSource(conf);
+    }

Review comment:
       Instead of duplicating this logic from `initialize`:
   
   
https://github.com/apache/ozone/blob/09579756b0756fcaf1b22b860c1ee1eb927e82c2/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java#L161-L166
   
   I think it would be cleaner to store this `ConfigurationSource`
   
   * either in `BasicOzoneFileSystem`
   * or in `BasicOzoneClientAdapterImpl` (and expose it via accessor method)
   
   and then use it here.




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