Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

urlyy
Copy link
Contributor

@urlyy urlyy commented Jun 2, 2025

What does this PR do?

Prepare to implement xlang metashare encode&decode in pyfory.
Now finish field_info and type_info(TypeDef) in python not cython.
I will continue to finish type_resolver for registry.

other small change:

  • Add Buffer::write_uint8 for writing 1 byte header.
  • Add metastring encoding options for field_name and namespace metastring encode.

Some Question

  • Still confused about naming. For me, I want to change all class_ prefix to type_, like class_info -> type_info, class_resolver -> type_resolver. So it will be unified.
  • There is not writeVarUint32Small7 in pyfury cython. Now I use write_varuint32. Should I add this function?
  • Now I just finish the xlang TypeDefMeta specification. As the java version is too complex to imitate, I use my way to implement this: not use outer Encoder/Decoder/Resolver class, just implement the xread/xwrite logic in type_info/field_info class. If this is not good, I will rewrite this part.
  • Is Java now support testing with python using Xlang&Compatible mode?

Related issues

#2160

Does this PR introduce any user-facing change?

WIP

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

TODO

@urlyy urlyy requested a review from chaokunyang as a code owner June 2, 2025 07:52
@urlyy urlyy changed the title feat(python): support xlang metashare feat(python): support xlang metashare (WIP) Jun 2, 2025
SCHEMA_CONSISTENT = 1
COMPATIBLE = 2

class MetaContext:
Copy link
Collaborator

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

@chaokunyang
Copy link
Collaborator

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

@urlyy
Copy link
Contributor Author

urlyy commented Jun 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants