-
Notifications
You must be signed in to change notification settings - Fork 829
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
Recommendation for CompatibleFieldSerializer #684
Comments
Sorry for the very late response! You lost me at:
Each field is written chunked, so when we can't read a field and Maybe you can explain more how you are using your proposed change? |
is a wrong spelling,I mean
which means in serializing This change is try to resolve this problem, force kryo read the next chunk is safely, if This change is already in our project and works fine, so you can consider merge this PR #686 |
Sorry it's been so long. While I don't have time right now to run the code in the PR, it doesn't appear valid to use the Object registration when |
I read the example in #643, and I see that in @NathanSweet last comment says when decode
SomeClass#anotherClass
butAnotherClass
's structure is missing, it will cause decode failure. BecauseCompatibleFieldSerializer
serialize is great depandency in order. When reading, theAnotherClass
class doesn't exist, Kryo will skipAnotherClass
's chunked input buffer.See
CompatibleFieldSerializer#read
'sreadUnknownTagData
part down below.But the information of
SomeClass#value
is still int that buffer, so if we continue read the remaing buffer that we can cache theSomeClass#value
inSomeClass#anotherClass
's chunked input.So I simply do that:
If Kryo can't find the Class so we give it a default Class that has no field in it, then Kryo successfully read the remaing byte in buffer and cache the
SomeClass#value
inSomeClass#anotherClass
's chunked input.This change is usefull in my case, but I don't know it will have impact for other case? Or you consider add this change (maybe with configurable) in futrue release?
Looking forward to your reply.
The text was updated successfully, but these errors were encountered: