-
Notifications
You must be signed in to change notification settings - Fork 548
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
Remove guava from data-avro. #409
Remove guava from data-avro. #409
Conversation
This is good. There was an effort in the past to remove Guava completely from Rest.li, since supposedly Guava often causes transitive dependency problems. It was left in a couple complex cases, this being one of them, however the intention was to completely remove it. This is a step in the right direction. As for where to place the shadowed code, that's a little tricky. In the past, we've included shadowed code in separate modules such as |
Thanks for reviewing! What you wrote makes sense. I don't mind either way (and don't have a strong opinion either). |
data-avro/src/main/java/com/linkedin/data/avro/PegasusUnionToAvroRecordConvertCallback.java
Outdated
Show resolved
Hide resolved
The only usage of Guava in data-avro is the CaseFormat class, which is used to convert from lower case camel-case to upper case camel-case. I don't think it justifies pulling in the entire library (which is 2.1 MB in version 18 and 2.6 MB in version 28.1 plus around 1.5 MB of source). The CaseFormat class has some dependencies, including one on CaseMatcher that isn't easy to remove, so I've copied over that code from the latest version of Guava for now (manually shading them) and updated a minimum amount of code to remove other dependencies on Preconditions, Converter, and annotations.
I updated the code to remove usage of CaseFormat and reused the code from Guava to transform a character from lowercase to uppercase. |
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.
Glad we're able to solve this now without shadowing any Guava source files 😄
LGTM, we'll bundle this with the next major version release
The only usage of Guava in data-avro is the CaseFormat class, which is used to convert from lower case camel-case to upper case camel-case. I don't think it justifies pulling in the entire library (which is 2.1 MB in version 18 and 2.6 MB in version 28.1 plus around 1.5 MB of source). The CaseFormat class has some dependencies, including one on CaseMatcher that isn't easy to remove, so I've copied over that code from the latest version of Guava for now (manually shading them) and updated a minimum amount of code to remove other dependencies on Preconditions, Converter, and annotations.
The only usage of Guava in data-avro is the CaseFormat class, which is
used to convert from lower case camel-case to upper case camel-case. I
don't think it justifies pulling in the entire library (which is 2.1 MB
in version 18 and 2.6 MB in version 28.1 plus around 1.5 MB of source).
The CaseFormat class has some dependencies, including one on CaseMatcher
that isn't easy to remove, so I've copied over that code from the latest
version of Guava for now (manually shading them) and updated a minimum
amount of code to remove other dependencies on Preconditions, Converter,
and annotations.
Note: Please add the backwards-incompatible label.