geyanggang commented on code in PR #15131:
URL: https://github.com/apache/gravitino/pull/15131#discussion_r4638169399
##########
bundles/aws-bundle/build.gradle.kts:
##########
@@ -18,14 +18,106 @@
* under the License.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+import java.util.zip.ZipEntry
+import java.util.zip.ZipFile
+import java.util.zip.ZipOutputStream
plugins {
`maven-publish`
id("java")
alias(libs.plugins.shadow)
}
+/**
+ * Removes the unrelocated Netty copy that aws-java-sdk-bundle (AWS SDK for
Java v1, pulled in by
+ * hadoop-aws) embeds under io/netty.
+ *
+ * A dependency constraint cannot replace classes that live inside another
jar. Left in place, those
+ * classes are merged with the standalone Netty jars used by the AWS SDK v2,
and the bundle ends up
+ * with classes and metadata of two different Netty releases. The standalone
Netty jars provide every
+ * module embedded in aws-java-sdk-bundle, and the embedded classes are binary
compatible with them
+ * within the 4.1 line, so removing the embedded copy leaves a single Netty
release in the bundle.
+ * Other jars pass through unchanged.
+ */
+@CacheableTransform
+abstract class StripEmbeddedNettyTransform :
TransformAction<TransformParameters.None> {
+ companion object {
+ val STRIPPED: Attribute<Boolean> =
+ Attribute.of("org.apache.gravitino.embedded-netty-stripped",
Boolean::class.javaObjectType)
+ const val EMBEDDING_JAR_PREFIX = "aws-java-sdk-bundle-"
+ private val NETTY_ENTRY_PREFIXES = listOf(
+ "io/netty/",
Review Comment:
Agreed. I'll push the real fix via an overall upgrade of the cloud SDKs
(aws-java-sdk-bundle to a release embedding Netty 4.1.140.Final). For this PR,
I'll drop the AWS transform, keep the 4.1.86 metadata/exemptions until then,
and add a regression check on the AWS-shaded implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]