Skip to content

Commit 948a917

Browse files
committed
Core, Hive, Nessie: Use ResolvingFileIO as default instead of HadoopFileIO
1 parent f5f543a commit 948a917

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public class JdbcCatalog extends BaseMetastoreCatalog
6767
private static final String NAMESPACE_EXISTS_PROPERTY = "exists";
6868
private static final Logger LOG = LoggerFactory.getLogger(JdbcCatalog.class);
6969
private static final Joiner SLASH = Joiner.on("/");
70+
private static final String DEFAULT_FILE_IO_IMPL = "org.apache.iceberg.io.ResolvingFileIO";
7071

7172
private FileIO io;
7273
private String catalogName = "jdbc";
@@ -112,9 +113,7 @@ public void initialize(String name, Map<String, String> properties) {
112113
if (null != ioBuilder) {
113114
this.io = ioBuilder.apply(properties);
114115
} else {
115-
String ioImpl =
116-
properties.getOrDefault(
117-
CatalogProperties.FILE_IO_IMPL, "org.apache.iceberg.hadoop.HadoopFileIO");
116+
String ioImpl = properties.getOrDefault(CatalogProperties.FILE_IO_IMPL, DEFAULT_FILE_IO_IMPL);
118117
this.io = CatalogUtil.loadFileIO(ioImpl, properties, conf);
119118
}
120119

hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.apache.iceberg.exceptions.NoSuchNamespaceException;
4848
import org.apache.iceberg.exceptions.NoSuchTableException;
4949
import org.apache.iceberg.exceptions.NotFoundException;
50-
import org.apache.iceberg.hadoop.HadoopFileIO;
5150
import org.apache.iceberg.io.FileIO;
5251
import org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
5352
import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
@@ -72,6 +71,7 @@ public class HiveCatalog extends BaseMetastoreCatalog implements SupportsNamespa
7271
static final String HIVE_CONF_CATALOG = "metastore.catalog.default";
7372

7473
private static final Logger LOG = LoggerFactory.getLogger(HiveCatalog.class);
74+
private static final String DEFAULT_FILE_IO_IMPL = "org.apache.iceberg.io.ResolvingFileIO";
7575

7676
private String name;
7777
private Configuration conf;
@@ -104,11 +104,9 @@ public void initialize(String inputName, Map<String, String> properties) {
104104
this.listAllTables =
105105
Boolean.parseBoolean(properties.getOrDefault(LIST_ALL_TABLES, LIST_ALL_TABLES_DEFAULT));
106106

107-
String fileIOImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
108-
this.fileIO =
109-
fileIOImpl == null
110-
? new HadoopFileIO(conf)
111-
: CatalogUtil.loadFileIO(fileIOImpl, properties, conf);
107+
String fileIOImpl =
108+
properties.getOrDefault(CatalogProperties.FILE_IO_IMPL, DEFAULT_FILE_IO_IMPL);
109+
this.fileIO = CatalogUtil.loadFileIO(fileIOImpl, properties, conf);
112110

113111
this.clients = new CachedClientPool(conf, properties);
114112
}

nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public class NessieCatalog extends BaseMetastoreCatalog
6363
implements AutoCloseable, SupportsNamespaces, Configurable<Object> {
6464

6565
private static final Logger LOG = LoggerFactory.getLogger(NessieCatalog.class);
66+
private static final String DEFAULT_FILE_IO_IMPL = "org.apache.iceberg.io.ResolvingFileIO";
6667
private static final Joiner SLASH = Joiner.on("/");
6768
private static final String NAMESPACE_LOCATION_PROPS = "location";
6869
private NessieIcebergClient client;
@@ -79,9 +80,7 @@ public NessieCatalog() {}
7980
@Override
8081
public void initialize(String name, Map<String, String> options) {
8182
Map<String, String> catalogOptions = ImmutableMap.copyOf(options);
82-
String fileIOImpl =
83-
options.getOrDefault(
84-
CatalogProperties.FILE_IO_IMPL, "org.apache.iceberg.hadoop.HadoopFileIO");
83+
String fileIOImpl = options.getOrDefault(CatalogProperties.FILE_IO_IMPL, DEFAULT_FILE_IO_IMPL);
8584
// remove nessie prefix
8685
final Function<String, String> removePrefix =
8786
x -> x.replace(NessieUtil.NESSIE_CONFIG_PREFIX, "");

0 commit comments

Comments
 (0)