-
Notifications
You must be signed in to change notification settings - Fork 358
feat(python): support xlang metashare (WIP) #2278
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
…options, add Buffer::write_uint8
| SCHEMA_CONSISTENT = 1 | ||
| COMPATIBLE = 2 | ||
|
|
||
| class MetaContext: |
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.
We'd better to put this class in _serialization.pyx for better performance
|
It would be great if we could change all class_ prefix to type_, like class_info -> type_info, class_resolver -> type_resolver. This will make the code more clean. How about opening another PR for this? After that PR is merged, we could merge from main branch again to resovle the conflicts |
ok |
|
@urlyy Hi, are you considering continuing to implement this PR? |
Sorry😢, I've been a bit busy these days, and the PR is a bit troublesome for me. I don't think I'll continue working on this PR. |
## Why? type forward/backward compatible serialization is critical for online service which different service update their data schema and deploy at different time. The schema is in an inconsistent state. meta shared encoding can address this : https://fory.apache.org/docs/specification/fory_xlang_serialization_spec#type-def ## What does this PR do? Add type meta encoding for python to support type forward/backward compatible serialization. Things not finished in this PR: - not null field support - generate serializer from type meta - meta share mode Those feature will be implemented in follow-up PRs. ## Related issues #1938 #2160 #2278 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] 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. Delete section if not applicable. -->
) ## Why? implement meta share mode for pyfory, so the struct can add/delete fields and have inconsistent schema bettween serialization and deserialization ## What does this PR do? <!-- Describe the details of this PR. --> ## Related issues #2509 #1938 #2160 #2278 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] 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. Delete section if not applicable. -->
#2602) ## Why? align java and python compatible mode serialization ## What does this PR do? <!-- Describe the details of this PR. --> ## Related issues #2509 #1938 #2160 #2278 #2593 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] 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. Delete section if not applicable. -->
What does this PR do?
Prepare to implement xlang metashare encode&decode in pyfory.
Now finish
field_infoandtype_info(TypeDef)in python not cython.I will continue to finish type_resolver for registry.
other small change:
Buffer::write_uint8for writing 1 byte header.Some Question
class_prefix totype_, likeclass_info -> type_info,class_resolver -> type_resolver. So it will be unified.writeVarUint32Small7in pyfury cython. Now I usewrite_varuint32. Should I add this function?xread/xwritelogic intype_info/field_infoclass. If this is not good, I will rewrite this part.Related issues
#2160
Does this PR introduce any user-facing change?
WIP
Benchmark
TODO