Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#1713] feat: upgrade hadoop2 to hadoop3 (#2329)

YongXing2910872bd72e
diff --git a/catalogs/catalog-hadoop/build.gradle.kts b/catalogs/catalog-hadoop/build.gradle.kts
index 842c165f7a..dbaf821017 100644
--- a/catalogs/catalog-hadoop/build.gradle.kts
+++ b/catalogs/catalog-hadoop/build.gradle.kts
@@ -16,15 +16,16 @@ dependencies {
implementation(project(":common"))
implementation(libs.guava)
- implementation(libs.hadoop2.common) {
+ implementation(libs.hadoop3.common) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}
- implementation(libs.hadoop2.hdfs) {
+ implementation(libs.hadoop3.hdfs) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}
+ implementation(libs.hadoop3.client)
implementation(libs.slf4j.api)
diff --git a/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java b/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java
index b6eb18c568..e7d1f2b57e 100644
--- a/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java
+++ b/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java
@@ -149,7 +149,7 @@ public class TestHadoopCatalogOperations {
Path schemaPath = new Path(catalogPath, name);
FileSystem fs = schemaPath.getFileSystem(new Configuration());
Assertions.assertTrue(fs.exists(schemaPath));
- Assertions.assertTrue(fs.isDirectory(schemaPath));
+ Assertions.assertTrue(fs.getFileStatus(schemaPath).isDirectory());
Assertions.assertTrue(fs.listStatus(schemaPath).length == 0);
}
@@ -165,7 +165,7 @@ public class TestHadoopCatalogOperations {
Path schemaPath1 = new Path(schemaPath);
FileSystem fs = schemaPath1.getFileSystem(new Configuration());
Assertions.assertTrue(fs.exists(schemaPath1));
- Assertions.assertTrue(fs.isDirectory(schemaPath1));
+ Assertions.assertTrue(fs.getFileStatus(schemaPath1).isDirectory());
Assertions.assertTrue(fs.listStatus(schemaPath1).length == 0);
}
@@ -181,7 +181,7 @@ public class TestHadoopCatalogOperations {
Path schemaPath1 = new Path(schemaPath);
FileSystem fs = schemaPath1.getFileSystem(new Configuration());
Assertions.assertTrue(fs.exists(schemaPath1));
- Assertions.assertTrue(fs.isDirectory(schemaPath1));
+ Assertions.assertTrue(fs.getFileStatus(schemaPath1).isDirectory());
Assertions.assertTrue(fs.listStatus(schemaPath1).length == 0);
Assertions.assertFalse(fs.exists(new Path(catalogPath)));
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 600278dbca..71deaac89e 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -17,6 +17,7 @@ airlift-units = "1.8"
airlift-log = "231"
hive2 = "2.3.9"
hadoop2 = "2.10.2"
+hadoop3 = "3.1.0"
hadoop-minikdc = "3.3.6"
httpclient5 = "5.2.1"
mockserver = "5.15.0"
@@ -99,6 +100,10 @@ hive2-common = { group = "org.apache.hive", name = "hive-common", version.ref =
hadoop2-hdfs = { group = "org.apache.hadoop", name = "hadoop-hdfs", version.ref = "hadoop2" }
hadoop2-common = { group = "org.apache.hadoop", name = "hadoop-common", version.ref = "hadoop2"}
hadoop2-mapreduce-client-core = { group = "org.apache.hadoop", name = "hadoop-mapreduce-client-core", version.ref = "hadoop2"}
+hadoop3-hdfs = { group = "org.apache.hadoop", name = "hadoop-hdfs", version.ref = "hadoop3" }
+hadoop3-common = { group = "org.apache.hadoop", name = "hadoop-common", version.ref = "hadoop3"}
+hadoop3-client = { group = "org.apache.hadoop", name = "hadoop-client", version.ref = "hadoop3"}
+hadoop3-mapreduce-client-core = { group = "org.apache.hadoop", name = "hadoop-mapreduce-client-core", version.ref = "hadoop3"}
airlift-units = { group = "io.airlift", name = "units", version.ref = "airlift-units"}
airlift-log = { group = "io.airlift", name = "log", version.ref = "airlift-log"}
httpclient5 = { group = "org.apache.httpcomponents.client5", name = "httpclient5", version.ref = "httpclient5" }