You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/12/15 19:12:54 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #1703: HDDS-4591. BasicOzoneFileSystem reports StorageUnit class not found.

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:
users@infra.apache.org



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