This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e45c0f88 [#4525] improvement(catalog-hadoop): Shrink Hadoop catalog 
binary package size to about 30MB. (#4535)
1e45c0f88 is described below

commit 1e45c0f88f09bb459ab4ae6517accc6399c346e9
Author: Qi Yu <[email protected]>
AuthorDate: Thu Aug 29 02:08:13 2024 +0800

    [#4525] improvement(catalog-hadoop): Shrink Hadoop catalog binary package 
size to about 30MB. (#4535)
    
    ### What changes were proposed in this pull request?
    
    Remove some unused dependencies to reduce hadoop catalog package size to
    44MB
    
    ### Why are the changes needed?
    
    Reduce the size of the total release package.
    
    Fix: #4525
    
    ### Does this PR introduce _any_ user-facing change?
    
    N/A.
    
    ### How was this patch tested?
    
    Exist UT and IT.
---
 catalogs/catalog-hadoop/build.gradle.kts | 47 ++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 6 deletions(-)

diff --git a/catalogs/catalog-hadoop/build.gradle.kts 
b/catalogs/catalog-hadoop/build.gradle.kts
index 8c962fe9b..ea38a895f 100644
--- a/catalogs/catalog-hadoop/build.gradle.kts
+++ b/catalogs/catalog-hadoop/build.gradle.kts
@@ -25,21 +25,45 @@ plugins {
 }
 
 dependencies {
-  implementation(project(":api"))
-  implementation(project(":core"))
-  implementation(project(":common"))
+  implementation(project(":api")) {
+    exclude(group = "*")
+  }
+
+  implementation(project(":core")) {
+    exclude(group = "*")
+  }
+  implementation(project(":common")) {
+    exclude(group = "*")
+  }
 
-  implementation(libs.guava)
   implementation(libs.hadoop3.common) {
     exclude("com.sun.jersey")
     exclude("javax.servlet", "servlet-api")
+    exclude("org.eclipse.jetty", "*")
+    exclude("org.apache.hadoop", "hadoop-auth")
+    exclude("org.apache.curator", "curator-client")
+    exclude("org.apache.curator", "curator-framework")
+    exclude("org.apache.curator", "curator-recipes")
+    exclude("org.apache.avro", "avro")
+    exclude("com.sun.jersey", "jersey-servlet")
   }
 
   implementation(libs.hadoop3.hdfs) {
     exclude("com.sun.jersey")
     exclude("javax.servlet", "servlet-api")
+    exclude("com.google.guava", "guava")
+    exclude("commons-io", "commons-io")
+    exclude("org.eclipse.jetty", "*")
+    exclude("io.netty")
+    exclude("org.fusesource.leveldbjni")
+  }
+  implementation(libs.hadoop3.client) {
+    exclude("org.apache.hadoop", "hadoop-mapreduce-client-core")
+    exclude("org.apache.hadoop", "hadoop-mapreduce-client-jobclient")
+    exclude("org.apache.hadoop", "hadoop-yarn-api")
+    exclude("org.apache.hadoop", "hadoop-yarn-client")
+    exclude("com.squareup.okhttp", "okhttp")
   }
-  implementation(libs.hadoop3.client)
 
   implementation(libs.slf4j.api)
 
@@ -71,7 +95,18 @@ tasks {
 
   val copyCatalogLibs by registering(Copy::class) {
     dependsOn("jar", "runtimeJars")
-    from("build/libs")
+    from("build/libs") {
+      exclude("slf4j-*.jar")
+      exclude("guava-*.jar")
+      exclude("curator-*.jar")
+      exclude("netty-*.jar")
+      exclude("snappy-*.jar")
+      exclude("zookeeper-*.jar")
+      exclude("jetty-*.jar")
+      exclude("javax.servlet-*.jar")
+      exclude("kerb-*.jar")
+      exclude("kerby-*.jar")
+    }
     into("$rootDir/distribution/package/catalogs/hadoop/libs")
   }
 

Reply via email to