Skip to content

[FLINK-38860] Remove flink shaded guava usage#1047

Merged
gyfora merged 1 commit into
apache:mainfrom
gyfora:FLINK-38860
Jan 5, 2026
Merged

[FLINK-38860] Remove flink shaded guava usage#1047
gyfora merged 1 commit into
apache:mainfrom
gyfora:FLINK-38860

Conversation

@gyfora
Copy link
Copy Markdown
Contributor

@gyfora gyfora commented Jan 5, 2026

What is the purpose of the change

The kubernetes operator uses flink shaded classes, this can be very problematic if the operator api is used as a library from other apps to submit resources. We should follow the standard best prectice of not using flink shaded classes outside core flink.

Brief change log

  • Remove shaded guava usage and replace with regular guava
  • Update checkstyle
  • Update Notice file

Verifying this change

Unit test and test in prod envs

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changes to the CustomResourceDescriptors: no
  • Core observer or reconciler logic that is regularly executed: yes

Documentation

  • Does this pull request introduce a new feature? no

@gyfora gyfora requested review from gaborgsomogyi and mxm January 5, 2026 08:03
Comment thread tools/maven/checkstyle.xml Outdated
<module name="IllegalImport">
<property name="illegalPkgs" value="com.google.common"/>
<message key="import.illegal" value="{0}; Use flink-shaded-guava instead."/>
<property name="illegalPkgs" value="org.apache.flink.shaded.guava31"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this regex be a bit more general to guard against new shaded guava releases?

Suggested change
<property name="illegalPkgs" value="org.apache.flink.shaded.guava31"/>
<property name="illegalPkgs" value="org.apache.flink.shaded.guava.*"/>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried different alternatives: shaded.guava, shaded.guava*, shaded.guava.* non of them actually worked unfortunately, so I have given up

Copy link
Copy Markdown
Contributor

@mxm mxm Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work:

Suggested change
<property name="illegalPkgs" value="org.apache.flink.shaded.guava31"/>
<property name="illegalPkgs" regexp="true" value="org.apache.flink.shaded.guava.*"/>

Note that regex feature needs to be enabled. See https://checkstyle.sourceforge.io/checks/imports/illegalimport.html#Properties

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nice! thank you

@gaborgsomogyi
Copy link
Copy Markdown
Contributor

  Error:                          {"type":"org.apache.flink.kubernetes.operator.exception.DeploymentFailedException","message":"[artifacts-fetcher] toomanyrequests: You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit","additionalMetadata":{"reason":"ErrImagePull"},"throwableList":[]}

Copy link
Copy Markdown
Contributor

@gaborgsomogyi gaborgsomogyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good

@gyfora gyfora merged commit 723eb75 into apache:main Jan 5, 2026
118 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants