-
Notifications
You must be signed in to change notification settings - Fork 343
refactor(Rust&Java&Python): use varint32 as type id for int32 #2898
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
|
@chaokunyang Is ForyJava hasn’t updated the |
Could we update java implementation in this PR too? |
I will try. |
But I don’t have time to refactor these. If it's not urgent, I will continue working on this PR in four or five days. |
@urlyy It's not urgent, you can take your time |
|
@chaokunyang Can we modify the format of The reason is that Rust needs to compute the Separating the two compression flags can effectively mitigate this situation. Which means, for |
|
|
Currently, the behavior of |
|
Could we remove I prefer a macro attr: struct Foo {
[#fory(compress=False)]
f1: i32
}For java, we can create an annotation: class Foo {
@ForyField(compress=false)
int f1:
}For python, we can create a We can support |
OK, I will implement the compress_int annotation on member variable for each language one by one in separate PRs, and then open another PR at the end for cross-language testing. |
What does this PR do?
type_resolverparameter tofory_static_type_id()andfory_reserved_space()so thattype_resolver.is_compress_int()can be used to decide whether to useread/write_varint32()orread/write_i32().compress_int()method toForyto allow users to configure whether integers should be compressed; default istrue.impl Serializer for i32.Related issues
#2884
#2885
#2886
Does this PR introduce any user-facing change?
Users can configure whether to compress integers by calling
fory.compress_int(true/false).