You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/22 02:13:52 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #4183: Flink: Implement catalog Factory interface (#3117)

kbendick commented on a change in pull request #4183:
URL: https://github.com/apache/iceberg/pull/4183#discussion_r811525178



##########
File path: flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/CatalogLoader.java
##########
@@ -155,4 +210,55 @@ public String toString() {
     }
   }
 
+  class BaseCatalogLoader implements CatalogLoader {
+
+    private final Map<String, String> options;
+    private final String catalogName;
+    private final SerializableConfiguration hadoopConf;
+
+    private BaseCatalogLoader(
+            CatalogFactory.Context context
+    ) {
+      this.options = Maps.newHashMap(context.getOptions()); // wrap into a hashmap for serialization
+      this.catalogName = context.getName();
+      // Check to see if there are hadoop classes loaded in Flink's application classloader
+      if (isHadoopEnv(context.getClassLoader().getParent())) {

Review comment:
       We also have an interface marker, `org.apache.iceberg.hadoop.Configurable<C>`, which is used for a similar purpose (to avoid the dependency on hadoop).
   
   It can be mixed in and then there's a marker you can check possibly. Here's an exmaple usage of it in `GlueCatalog`: https://github.com/apache/iceberg/blob/8afcdffd905fa284f20f6f84fba649d28fb7d923/aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java#L76-L82




-- 
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-unsubscribe@iceberg.apache.org

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



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