-
Notifications
You must be signed in to change notification settings - Fork 23
Update cache to caffeine #62
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
Conversation
|
Thanks! I'm really out of the loop around most things JVM these days, but it seems reasonable to me. @scholzj, wdyt? |
|
I think originally, the use of Guava was good because Kafka already used Guava in the first place. However, that is not the case anymore and Kafka seems to be using Caffeine now as well (not sure what exactly they use it for and if the motivation for the change was the same as suggested here or completely different). So I think moving to Caffeine might make sense. But as the Kafka 4.0 and latest main branch are using Caffeine 3.1, it would be good to understand if it works with that as well (I have no idea what the differences are between Caffeine 3.1 and 3.2 and if they are backward compatible - avoiding multiple versions on the classpath always makes things easier). |
build.gradle
Outdated
| !(it.moduleGroup in [ | ||
| 'org.openpolicyagent.kafka', | ||
| 'com.google.guava' | ||
| 'com.google.guava', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess if we don't use it anymore, there is no reason to list it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be some white space changes here which will screw up the Git history. Can we keep only the real code changes and remove the whitespace changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed please check
|
@kirillovsky LGTM, but could you please revert the whitespace changes so that we can merge this? Thanks! |
41fe094 to
b032af1
Compare
|
@anderseknert @scholzj Thanks for checking my PR. Fixed |
|
@anderseknert @scholzj Regarding useless whitespaces in my PR. It's happens case my IDEA automatically changes Line separator from LF (POSIX style) to CRLF (OS Windows style). But there is a way to avoid it automatically (via .gitattributes) - https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings#per-repository-settings. Can i add it to your repo? What do you think? |
b032af1 to
27b94d2
Compare
27b94d2 to
2320fe1
Compare
anderseknert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! The majority of changes still look style related though? If you want to break up long lines or fix style issues, it's always better to do so in a PR only submitted for that purpose, as combining a change in behavior/semantics and style changes makes reviewing much more difficult. But that aside, looks good to me, and @scholzj is you agree, go ahead and merge.
scholzj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM.
Yeah, I agree that in general it is best to do such changes in a separate PR to have clearer history. |
Hi! Looks like you use Guava only for caching. Did you consider to migrate from Guava to Caffeine?
Caffeine advantages:
Examples of comments from guava maintainers on this matter:
More examples - Consider Caffeine for Caching to Replace Guava After EOL of Java 7 Support newrelic/newrelic-java-agent#258 (comment)
compared to a large set of common utils that cover a large set of developer needs (Guava)
More other it's reduce Opa-Kafka-Plugin fat-jar size from 2.9MB to 917Kb