-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-33017] Remove dependency on shaded guava #46
Closed
Gerrrr
wants to merge
8
commits into
apache:main
from
Gerrrr:FLINK-33017-remove-shaded-guava-dependency
Closed
[FLINK-33017] Remove dependency on shaded guava #46
Gerrrr
wants to merge
8
commits into
apache:main
from
Gerrrr:FLINK-33017-remove-shaded-guava-dependency
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The bump in shaded guava in Flink 1.18 changed import paths and caused the class loader fail when loading ManagedMemoryUtils. Looking at the root cause of the issue, shading was used as a technique to avoid dependency hell. As flink-connector-kafka should work with both flink 1.17 and 1.18 that use different guava versions (and hence library import paths), shading did not really solve the problem it was introduced for in the first place. There are several several options to work around the problem. First, we could introduce our own shading for guava. Second, we could see if the dependency on guava is necessary at all and maybe remove it completely. This patch takes the latter route and removes dependency on guava from this connector.
tzulitai
reviewed
Sep 6, 2023
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriter.java
Outdated
Show resolved
Hide resolved
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriter.java
Outdated
Show resolved
Hide resolved
...ka/src/test/java/org/apache/flink/connector/kafka/sink/FlinkKafkaInternalProducerITCase.java
Outdated
Show resolved
Hide resolved
...ka/src/test/java/org/apache/flink/streaming/connectors/kafka/shuffle/KafkaShuffleITCase.java
Show resolved
Hide resolved
Gerrrr
commented
Sep 6, 2023
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriter.java
Show resolved
Hide resolved
tzulitai
reviewed
Sep 6, 2023
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriter.java
Outdated
Show resolved
Hide resolved
* rename closeables to producerCloseables * change the order of calls in KafkaWriter#close
Closed via 818d1fd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The bump in shaded guava in Flink 1.18 changed import paths and caused the class loader fail when loading ManagedMemoryUtils.
Looking at the root cause of the issue, shading was used as a technique to avoid dependency hell. As flink-connector-kafka should work with both flink 1.17 and 1.18 that use different guava versions (and hence library import paths), shading did not really solve the problem it was introduced for in the first place.
There are several several options to work around the problem. First, we could introduce our own shading for guava. Second, we could see if the dependency on guava is necessary at all and maybe remove it completely.
This patch takes the latter route and removes dependency on guava from this connector.
Testing strategy
Ran locally
and no longer observed
Could not initialize class org.apache.flink.runtime.util.config.memory.ManagedMemoryUtils
in the logs.