Skip to content

Commit

Permalink
[#5145] improvement(flink-connector): Shrink the flink-connector-runt…
Browse files Browse the repository at this point in the history
…ime lib size from 84MB to 16MB (#4819)

### What changes were proposed in this pull request?

- shrink the flink-connector-runtime jar.
- Change client-java scope from implementation to CompileOnly in flink
module.
- use the client-java-runtime in flink-connector-runtime.

### Why are the changes needed?
Fix: #5145 


- The flink-connector-runtime jar is much big as mentioned in
#4791 (comment).


### Does this PR introduce _any_ user-facing change?

- no

### How was this patch tested?

- local test
  • Loading branch information
coolderli authored Oct 15, 2024
1 parent 5f73e62 commit f0e7f36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion flink-connector/flink-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ tasks.withType<ShadowJar>(ShadowJar::class.java) {
relocate("com.google", "org.apache.gravitino.shaded.com.google")
relocate("google", "org.apache.gravitino.shaded.google")
relocate("org.apache.hc", "org.apache.gravitino.shaded.org.apache.hc")
relocate("org.apache.commons", "org.apache.gravitino.shaded.org.apache.commons")
}

publishing {
Expand Down
20 changes: 6 additions & 14 deletions flink-connector/flink/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ val scalaVersion: String = "2.12"
val artifactName = "${rootProject.name}-flink-${flinkMajorVersion}_$scalaVersion"

dependencies {
implementation(project(":api"))
implementation(project(":catalogs:catalog-common"))
implementation(project(":common"))

compileOnly(libs.bundles.log4j)
implementation(libs.commons.lang3)
implementation(libs.guava)
implementation(libs.httpclient5)
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
implementation(libs.jackson.datatype.jdk8)
implementation(libs.jackson.datatype.jsr310)

compileOnly(project(":clients:client-java-runtime", configuration = "shadow"))

compileOnly("org.apache.flink:flink-connector-hive_$scalaVersion:$flinkVersion")
compileOnly("org.apache.flink:flink-table-common:$flinkVersion")
Expand All @@ -76,13 +68,13 @@ dependencies {
exclude("org.slf4j")
}

// replace with client-java-runtime in flink connector runtime
compileOnly(project(":clients:client-java"))

testAnnotationProcessor(libs.lombok)

testCompileOnly(libs.lombok)

testImplementation(project(":api"))
testImplementation(project(":clients:client-java"))
testImplementation(project(":core"))
testImplementation(project(":common"))
testImplementation(project(":integration-test-common", "testArtifacts"))
testImplementation(project(":server"))
testImplementation(project(":server-common"))
Expand Down

0 comments on commit f0e7f36

Please sign in to comment.