-
Notifications
You must be signed in to change notification settings - Fork 261
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
[Java] remove guava dependency #1113
Comments
@chaokunyang |
Hi @nandakumar131, thanks for the willingness to contribute to Fury. I haven't start part2 yet, you can take up this part work. FYI, Currently Fury uses guava TypeToken for generics inspection and use guava cache for some static data cache. These are the biggest dependency on guava |
Thanks @chaokunyang! |
@chaokunyang do we still want to support |
I prefer to still support it, but may use a way without source api dependency. For example, we use methodhandle to get all methods for invocation |
## What do these changes do? Remove guava part 2: Removed guava `Preconditions` usage Removed guava `Objects` usage Removed guava `MoreObjects` usage Removed guava `ImmutableList` Removed guava `ImmutableSet` & `ImmutableSortedSet` ## Related issue number #1113 ## Check code requirements - [ ] tests added / passed (if needed) - [ ] Ensure all linting tests pass, see [here](https://github.com/alipay/fury/blob/main/CONTRIBUTING.rst) for how to run them
This also helps in reducing JAR file size. Let me know if I can help you here. |
@Munoon That would be really great. Actually I am on the work of first release of Fury under asf and don't have enough time for this feature |
Can you please specify which exactly help you need? To complete @nandakumar131 PR or to do some further steps? |
Here are the things which may need to be finished to make guava optional:
|
OK, I'll separate those by different PRs starting from |
Yep, the |
@chaokunyang, sorry about the delay on #1273. @Munoon, feel free to take over #1273, if you have started working on |
## What does this PR do? Removes Guava's `TypeToken` usages and replaces it with a hand-made `TypeToken` implementation. To be honest, this is mostly a copy-paste of Guava's TypeToken with removing some unnecessary stuff. This implementation can be improved and optimized. ## Related issues #1113 #1273 --------- Co-authored-by: Nandakumar Vadivelu <nanda@apache.org>
## What does this PR do? Remove Guava's Collection usages ## Related issues <!-- Is there any related issue? Please attach here. - #xxxx0 - #xxxx1 - #xxxx2 --> #1113 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/incubator-fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? Lazy map become slightly more lazy =) <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. -->
<!-- **Thanks for contributing to Fury.** **If this is your first time opening a PR on fury, you can refer to [CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fury (incubating)** community has restrictions on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md). - Fury has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## What does this PR do? Removes Guava's Concurrency utils usages ## Related issues #1113 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/incubator-fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. -->
…mentation (#1624) ## What does this PR do? <!-- Describe the purpose of this PR. --> ## Related issues <!-- Is there any related issue? Please attach here. - #xxxx0 - #xxxx1 - #xxxx2 --> #1113 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/incubator-fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change?
Is your feature request related to a problem? Please describe.
Fury use guava for generic reflection, cache. But guava is used so widely, it's very likely to version conflict with users code.
Describe the solution you'd like
Remove guava dependency, implement all releated methods by fury self.
Here are the things which may need to be finished to make guava optional:
TypeRef
to replaceTypeToken
in guava, which is work that @nandakumar131 doing before.FinalizableWeakReference
which fury used to build a multi-key weak mapListeningExecutorService
which fury used to compile classes and register callbackcom.google.common.collect
usage in the src/main/java dir exceptorg.apache.fury.serializer.collection.GuavaCollectionSerializers
org.apache.fury.serializer.collection.GuavaCollectionSerializers
load stub classes, so even guava jar are not in classpath, teh fury init won't throw exception, like we did in org.apache.fury.serializer.collection.ImmutableCollectionSerializerscom.google.
are only used inGuavaCollectionSerializers
and test classes.Additional context
Shade guava is an option too, but introduce complexities for fury GuavaSerializers and guava CVE
The text was updated successfully, but these errors were encountered: