-
Notifications
You must be signed in to change notification settings - Fork 826
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
VersionedRecordSerializer? #884
Comments
@JanecekPetr: The I don't have to time work on this at the moment but I'd be happy to accept a PR. |
Okay, I actually started looking into this.
I'm happy to open new tickets and continue each thread elsewhere if needed. There's apparently a lot incoming :). (I'm also not a fan of serializing records alphabetically as it complicates the code unnecessarily, but that ship has sailed for sure. At least it's consistent with |
Actually we could still internally just do an internal Either way, some design work needs to be done before I actually start writing some more complex code. |
@JanecekPetr: Thanks a lot for looking into this! I'll think about these issues and will get back to you asap. |
@JanecekPetr: Thanks again for your valuable input!
Right, I'm using IntelliJ and haven't checked the Eclipse config. If you can, please provide a fix.
We will definitely find a solution for this. Your benchmark results make a good case, even for a breaking change. What I would suggest is to add the the new constructor and cache the results there. Then we deprecate the default constructor and cache the components on first access if they haven't been cached from the new constructor. WDYT?
I'd suggest we start with the simplest configuration possible and do not add any new options for now. As you said, this can easily be done retroactively, should anybody ask for it. Having said that, my biggest concern with the whole idea of a Ideally, we could abstract So to sum up: We can move ahead with improving the record serializer by adding caching and extending it to support versioning, but the ideal solution would be to let field serializer and its variant handle records. I'm just not sure it can actually be implemented. |
I agree overall, the fact that FieldSerializer can't pick a canonical constructor if there is one is a shame that could be optionally alleviated (at least since Java 8 where there sometimes are parameter names accessible to reflection). But that's another story and another ticket. For now the RecordSerializer exists and what you propose makes sense. I'll look into this and should have a POC this or next week. |
I didn't forget about this, I have a preliminary almost-working POC with tests and some benchmarks, but it requires more work and a cleanup pass. |
@JanecekPetr: Did you make any progress on this issue? I started preliminary work on refactoring the |
Oh my, indeed I have! |
@JanecekPetr: Ping ;) I'd like to do another Kryo 5.x release in the coming weeks. Any chance you can create a PR with your caching improvements? |
@JanecekPetr: I created a PR with caching for the Is this the same approach you took? I'm also seeing a 20x speed-up. |
Is your feature request related to a problem? Please describe.
I'm trying to serialize a Record that evolves - new components are being added to it.
Describe the solution you'd like
Would it make sense to create a
VersionedRecordSerializer
akin toVersionedFieldSerializer
with the same functionality, the@Since
annotation?Describe alternatives you've considered
An obvious workaround is to use a traditional class instead of a record.
The text was updated successfully, but these errors were encountered: