rdblue commented on a change in pull request #3590:
URL: https://github.com/apache/iceberg/pull/3590#discussion_r755426646



##########
File path: core/src/main/java/org/apache/iceberg/CatalogUtil.java
##########
@@ -266,11 +264,76 @@ public static FileIO loadFileIO(
           String.format("Cannot initialize FileIO, %s does not implement 
FileIO.", impl), e);
     }
 
-    if (fileIO instanceof Configurable) {
-      ((Configurable) fileIO).setConf(hadoopConf);
-    }
+    configureHadoopConf(fileIO, hadoopConf);
 
     fileIO.initialize(properties);
     return fileIO;
   }
+
+  /**
+   * Dynamically detects whether an object is a Hadoop Configurable and calls 
setConf.
+   * @param maybeConfigurable an object that may be Configurable
+   * @param conf a Configuration
+   */
+  @SuppressWarnings("unchecked")
+  public static void configureHadoopConf(Object maybeConfigurable, Object 
conf) {

Review comment:
       It seems useful? I think we could make it private though.




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