Skip to content

Commit

Permalink
Merge branch 'main' into iceberg-rest
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyouze authored Dec 27, 2024
2 parents 9e014e8 + 07cdcba commit d5ebecd
Show file tree
Hide file tree
Showing 61 changed files with 969 additions and 199 deletions.
10 changes: 5 additions & 5 deletions authorizations/authorization-chain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ dependencies {
exclude("net.java.dev.jna")
exclude("javax.ws.rs")
exclude("org.eclipse.jetty")
exclude("org.apache.hadoop", "hadoop-common")
}
testImplementation("org.apache.spark:spark-hive_$scalaVersion:$sparkVersion")
testImplementation("org.apache.spark:spark-sql_$scalaVersion:$sparkVersion") {
Expand All @@ -93,11 +94,10 @@ dependencies {
testImplementation("org.apache.kyuubi:kyuubi-spark-authz-shaded_$scalaVersion:$kyuubiVersion") {
exclude("com.sun.jersey")
}
testImplementation(libs.hadoop3.client)
testImplementation(libs.hadoop3.common) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}

testImplementation(libs.hadoop3.client.api)
testImplementation(libs.hadoop3.client.runtime)

testImplementation(libs.hadoop3.hdfs) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
Expand Down
11 changes: 6 additions & 5 deletions authorizations/authorization-ranger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ dependencies {
exclude("net.java.dev.jna")
exclude("javax.ws.rs")
exclude("org.eclipse.jetty")
// Conflicts with hadoop-client-api used in hadoop-catalog.
exclude("org.apache.hadoop", "hadoop-common")
}
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)

implementation(libs.rome)
compileOnly(libs.lombok)
testRuntimeOnly(libs.junit.jupiter.engine)
Expand All @@ -92,11 +97,7 @@ dependencies {
testImplementation("org.apache.kyuubi:kyuubi-spark-authz-shaded_$scalaVersion:$kyuubiVersion") {
exclude("com.sun.jersey")
}
testImplementation(libs.hadoop3.client)
testImplementation(libs.hadoop3.common) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}

testImplementation(libs.hadoop3.hdfs) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ tasks {
!it.name.startsWith("client") && !it.name.startsWith("filesystem") && !it.name.startsWith("spark") && !it.name.startsWith("iceberg") && it.name != "trino-connector" &&
it.name != "integration-test" && it.name != "bundled-catalog" && !it.name.startsWith("flink") &&
it.name != "integration-test" && it.name != "hive-metastore-common" && !it.name.startsWith("flink") &&
it.name != "gcp-bundle" && it.name != "aliyun-bundle" && it.name != "aws-bundle" && it.name != "azure-bundle" && it.name != "hadoop-common"
it.parent?.name != "bundles" && it.name != "hadoop-common"
) {
from(it.configurations.runtimeClasspath)
into("distribution/package/libs")
Expand All @@ -799,10 +799,8 @@ tasks {
!it.name.startsWith("integration-test") &&
!it.name.startsWith("flink") &&
!it.name.startsWith("trino-connector") &&
it.name != "bundled-catalog" &&
it.name != "hive-metastore-common" && it.name != "gcp-bundle" &&
it.name != "aliyun-bundle" && it.name != "aws-bundle" && it.name != "azure-bundle" &&
it.name != "hadoop-common" && it.name != "docs"
it.name != "hive-metastore-common" &&
it.name != "docs" && it.name != "hadoop-common" && it.parent?.name != "bundles"
) {
dependsOn("${it.name}:build")
from("${it.name}/build/libs")
Expand Down
38 changes: 11 additions & 27 deletions bundles/aliyun-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,12 @@ plugins {
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":core"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":catalogs:hadoop-common")) {
exclude("*")
}
compileOnly(libs.hadoop3.common)

implementation(libs.aliyun.credentials.sdk)
implementation(project(":bundles:aliyun"))
implementation(libs.commons.collections3)
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)
implementation(libs.hadoop3.oss)

// Aliyun oss SDK depends on this package, and JDK >= 9 requires manual add
// https://www.alibabacloud.com/help/en/oss/developer-reference/java-installation?spm=a2c63.p38356.0.i1
implementation(libs.sun.activation)

// oss needs StringUtils from commons-lang3 or the following error will occur in 3.3.0
// java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystemStore.initialize(AliyunOSSFileSystemStore.java:111)
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:323)
// org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3611)
implementation(libs.commons.lang3)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(libs.httpclient)
}

tasks.withType(ShadowJar::class.java) {
Expand All @@ -60,8 +40,12 @@ tasks.withType(ShadowJar::class.java) {
mergeServiceFiles()

// Relocate dependencies to avoid conflicts
relocate("org.jdom", "org.apache.gravitino.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.shaded.org.apache.commons.lang3")
relocate("org.jdom", "org.apache.gravitino.aliyun.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.aliyun.shaded.org.apache.commons.lang3")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aliyun.shaded.com.fasterxml.jackson")
relocate("com.google.common", "org.apache.gravitino.aliyun.shaded.com.google.common")
relocate("org.apache.http", "org.apache.gravitino.aliyun.shaded.org.apache.http")
relocate("org.apache.commons.collections", "org.apache.gravitino.aliyun.shaded.org.apache.commons.collections")
}

tasks.jar {
Expand Down
87 changes: 87 additions & 0 deletions bundles/aliyun/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
`maven-publish`
id("java")
alias(libs.plugins.shadow)
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":core"))
compileOnly(libs.hadoop3.client.api)
compileOnly(libs.hadoop3.client.runtime)
compileOnly(libs.hadoop3.oss)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(project(":catalogs:hadoop-common")) {
exclude("*")
}

implementation(libs.aliyun.credentials.sdk)
implementation(libs.commons.collections3)

// oss needs StringUtils from commons-lang3 or the following error will occur in 3.3.0
// java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystemStore.initialize(AliyunOSSFileSystemStore.java:111)
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:323)
// org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3611)
implementation(libs.commons.lang3)
implementation(libs.guava)

implementation(libs.httpclient)
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
implementation(libs.jackson.datatype.jdk8)
implementation(libs.jackson.datatype.jsr310)

// Aliyun oss SDK depends on this package, and JDK >= 9 requires manual add
// https://www.alibabacloud.com/help/en/oss/developer-reference/java-installation?spm=a2c63.p38356.0.i1
implementation(libs.sun.activation)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
archiveClassifier.set("")
mergeServiceFiles()

// Relocate dependencies to avoid conflicts
relocate("org.jdom", "org.apache.gravitino.aliyun.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.aliyun.shaded.org.apache.commons.lang3")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aliyun.shaded.com.fasterxml.jackson")
relocate("com.google.common", "org.apache.gravitino.aliyun.shaded.com.google.common")
relocate("org.apache.http", "org.apache.gravitino.aliyun.shaded.org.apache.http")
relocate("org.apache.commons.collections", "org.apache.gravitino.aliyun.shaded.org.apache.commons.collections")
}

tasks.jar {
dependsOn(tasks.named("shadowJar"))
archiveClassifier.set("empty")
}

tasks.compileJava {
dependsOn(":catalogs:catalog-hadoop:runtimeJars")
}
24 changes: 7 additions & 17 deletions bundles/aws-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,20 @@ plugins {
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":core"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":catalogs:hadoop-common")) {
exclude("*")
}
compileOnly(libs.hadoop3.common)

implementation(libs.aws.iam)
implementation(libs.aws.policy)
implementation(libs.aws.sts)
implementation(libs.commons.lang3)
implementation(project(":bundles:aws"))
implementation(libs.hadoop3.aws)
implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
relocate("org.apache.commons", "org.apache.gravitino.aws.shaded.org.apache.commons")
archiveClassifier.set("")

relocate("org.apache.commons.lang3", "org.apache.gravitino.aws.shaded.org.apache.commons.lang3")
relocate("com.google.common", "org.apache.gravitino.aws.shaded.com.google.common")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aws.shaded.com.fasterxml.jackson")
}

tasks.jar {
Expand Down
68 changes: 68 additions & 0 deletions bundles/aws/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
`maven-publish`
id("java")
alias(libs.plugins.shadow)
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":core"))
compileOnly(libs.hadoop3.aws)
compileOnly(libs.hadoop3.client.api)
compileOnly(libs.hadoop3.client.runtime)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(project(":catalogs:hadoop-common")) {
exclude("*")
}

implementation(libs.aws.iam)
implementation(libs.aws.policy)
implementation(libs.aws.sts)
implementation(libs.commons.lang3)
implementation(libs.hadoop3.aws)
implementation(libs.guava)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
archiveClassifier.set("")

relocate("org.apache.commons.lang3", "org.apache.gravitino.aws.shaded.org.apache.commons.lang3")
relocate("com.google.common", "org.apache.gravitino.aws.shaded.com.google.common")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aws.shaded.com.fasterxml.jackson")
}

tasks.jar {
dependsOn(tasks.named("shadowJar"))
archiveClassifier.set("empty")
}

tasks.compileJava {
dependsOn(":catalogs:catalog-hadoop:runtimeJars")
}
Loading

0 comments on commit d5ebecd

Please sign in to comment.