Skip to content

Commit 17a359b

Browse files
authored
Service: Remove hadoop-common from polaris-runtime-service (#2462)
1 parent 14d4496 commit 17a359b

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

runtime/service/build.gradle.kts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ dependencies {
7575

7676
implementation(libs.auth0.jwt)
7777

78-
implementation(libs.hadoop.common) {
79-
exclude("org.slf4j", "slf4j-reload4j")
80-
exclude("org.slf4j", "slf4j-log4j12")
81-
exclude("ch.qos.reload4j", "reload4j")
82-
exclude("log4j", "log4j")
83-
exclude("org.apache.zookeeper", "zookeeper")
84-
exclude("org.apache.hadoop.thirdparty", "hadoop-shaded-protobuf_3_25")
85-
exclude("com.github.pjfanning", "jersey-json")
86-
exclude("com.sun.jersey", "jersey-core")
87-
exclude("com.sun.jersey", "jersey-server")
88-
exclude("com.sun.jersey", "jersey-servlet")
89-
exclude("com.sun.jersey", "jersey-servlet")
90-
exclude("io.dropwizard.metrics", "metrics-core")
91-
}
92-
implementation(libs.hadoop.hdfs.client)
93-
9478
implementation(libs.smallrye.common.annotation)
9579
implementation(libs.swagger.jaxrs)
9680
implementation(libs.microprofile.fault.tolerance.api)

runtime/service/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.Map;
2828
import java.util.Optional;
2929
import java.util.Set;
30-
import org.apache.hadoop.conf.Configuration;
3130
import org.apache.iceberg.CatalogUtil;
3231
import org.apache.iceberg.catalog.TableIdentifier;
3332
import org.apache.iceberg.io.FileIO;
@@ -110,7 +109,6 @@ public FileIO loadFileIO(
110109
@VisibleForTesting
111110
FileIO loadFileIOInternal(
112111
@Nonnull String ioImplClassName, @Nonnull Map<String, String> properties) {
113-
return new ExceptionMappingFileIO(
114-
CatalogUtil.loadFileIO(ioImplClassName, properties, new Configuration()));
112+
return new ExceptionMappingFileIO(CatalogUtil.loadFileIO(ioImplClassName, properties, null));
115113
}
116114
}

runtime/service/src/main/java/org/apache/polaris/service/context/RealmContextResolver.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
*/
1919
package org.apache.polaris.service.context;
2020

21+
import java.util.HashMap;
22+
import java.util.Locale;
2123
import java.util.Map;
2224
import java.util.concurrent.CompletionStage;
2325
import java.util.function.Function;
24-
import org.apache.commons.collections.map.CaseInsensitiveMap;
2526
import org.apache.polaris.core.context.RealmContext;
2627

2728
/**
@@ -59,8 +60,11 @@ CompletionStage<RealmContext> resolveRealmContext(
5960
*/
6061
default CompletionStage<RealmContext> resolveRealmContext(
6162
String requestURL, String method, String path, Map<String, String> headers) {
62-
CaseInsensitiveMap caseInsensitiveMap = new CaseInsensitiveMap(headers);
63+
Map<String, String> caseInsensitiveMap = new HashMap<>();
64+
for (Map.Entry<String, String> entry : headers.entrySet()) {
65+
caseInsensitiveMap.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue());
66+
}
6367
return resolveRealmContext(
64-
requestURL, method, path, (key) -> (String) caseInsensitiveMap.get(key));
68+
requestURL, method, path, (key) -> caseInsensitiveMap.get(key.toLowerCase(Locale.ROOT)));
6569
}
6670
}

runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerAuthzTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.Optional;
3030
import java.util.Set;
3131
import java.util.UUID;
32-
import org.apache.hadoop.conf.Configuration;
3332
import org.apache.iceberg.CatalogProperties;
3433
import org.apache.iceberg.CatalogUtil;
3534
import org.apache.iceberg.PartitionSpec;
@@ -1785,7 +1784,7 @@ public Catalog createCallContextCatalog(
17851784
catalog.initialize(
17861785
externalCatalog, ImmutableMap.of(CatalogProperties.FILE_IO_IMPL, fileIoImpl));
17871786

1788-
FileIO fileIO = CatalogUtil.loadFileIO(fileIoImpl, Map.of(), new Configuration());
1787+
FileIO fileIO = CatalogUtil.loadFileIO(fileIoImpl, Map.of(), null);
17891788
TableMetadata tableMetadata =
17901789
TableMetadata.buildFromEmpty()
17911790
.addSchema(SCHEMA)

0 commit comments

Comments
 (0)