You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "MrChang0 (via GitHub)" <gi...@apache.org> on 2024/05/10 09:50:38 UTC
[PR] register old version guava collect [incubator-fury]
MrChang0 opened a new pull request, #1622:
URL: https://github.com/apache/incubator-fury/pull/1622
<!--
**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?
<!-- Describe the purpose of this PR. -->
before guava 19.0, of() return EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet. check class and register serializer for them.
## Related issues
<!--
Is there any related issue? Please attach here.
- #xxxx0
- #xxxx1
- #xxxx2
-->
## 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?
## Benchmark
<!--
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.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on code in PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622#discussion_r1596612498
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/GuavaCollectionSerializers.java:
##########
@@ -399,6 +400,26 @@ public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(cls, new ImmutableSortedSetSerializer<>(fury, cls));
cls = loadClass(pkg + ".ImmutableSortedMap", ImmutableSortedMap.of(1, 2).getClass());
fury.registerSerializer(cls, new ImmutableSortedMapSerializer<>(fury, cls));
+
+ // Guava version before 19.0, of() return
+ // EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet
+ // we register if class exist
+ if (checkClassExist(pkg + ".EmptyImmutableSet")) {
Review Comment:
> Could we make classes before and after guava 19.0 mapped to same class id. In this way, teh different guava version across processes won't introduce deserialization error
I perfer it more, with different guava version, it can take `of()` to deserialize.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622#discussion_r1596555578
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/GuavaCollectionSerializers.java:
##########
@@ -399,6 +400,26 @@ public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(cls, new ImmutableSortedSetSerializer<>(fury, cls));
cls = loadClass(pkg + ".ImmutableSortedMap", ImmutableSortedMap.of(1, 2).getClass());
fury.registerSerializer(cls, new ImmutableSortedMapSerializer<>(fury, cls));
+
+ // Guava version before 19.0, of() return
+ // EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet
+ // we register if class exist
+ if (checkClassExist(pkg + ".EmptyImmutableSet")) {
Review Comment:
If caller and server have different guava version, this method seems introduce deserialization error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622#discussion_r1596558395
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/GuavaCollectionSerializers.java:
##########
@@ -399,6 +400,26 @@ public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(cls, new ImmutableSortedSetSerializer<>(fury, cls));
cls = loadClass(pkg + ".ImmutableSortedMap", ImmutableSortedMap.of(1, 2).getClass());
fury.registerSerializer(cls, new ImmutableSortedMapSerializer<>(fury, cls));
+
+ // Guava version before 19.0, of() return
+ // EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet
+ // we register if class exist
+ if (checkClassExist(pkg + ".EmptyImmutableSet")) {
Review Comment:
Could we make classes before and after guava 19.0 mapped to same class id. In this way, teh different guava version across processes won't introduce deserialization error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622#discussion_r1596620384
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/GuavaCollectionSerializers.java:
##########
@@ -399,6 +400,26 @@ public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(cls, new ImmutableSortedSetSerializer<>(fury, cls));
cls = loadClass(pkg + ".ImmutableSortedMap", ImmutableSortedMap.of(1, 2).getClass());
fury.registerSerializer(cls, new ImmutableSortedMapSerializer<>(fury, cls));
+
+ // Guava version before 19.0, of() return
+ // EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet
+ // we register if class exist
+ if (checkClassExist(pkg + ".EmptyImmutableSet")) {
Review Comment:
If classid are different, the deserialization will laod wrong class and deserializer. We met such errors before. it's very hard to locate it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] feat(java): register old version guava collect [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on code in PR #1622:
URL: https://github.com/apache/incubator-fury/pull/1622#discussion_r1596721086
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/GuavaCollectionSerializers.java:
##########
@@ -399,6 +400,26 @@ public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(cls, new ImmutableSortedSetSerializer<>(fury, cls));
cls = loadClass(pkg + ".ImmutableSortedMap", ImmutableSortedMap.of(1, 2).getClass());
fury.registerSerializer(cls, new ImmutableSortedMapSerializer<>(fury, cls));
+
+ // Guava version before 19.0, of() return
+ // EmptyImmutableSet/EmptyImmutableBiMap/EmptyImmutableSortedMap/EmptyImmutableSortedSet
+ // we register if class exist
+ if (checkClassExist(pkg + ".EmptyImmutableSet")) {
Review Comment:
> If classid are different, the deserialization will laod wrong class and deserializer. We met such errors before. it's very hard to locate it
I see comments, and I take same classId to deserialize low version guava.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org