Skip to content
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

[FEATURE] Add @Externalizable #2146

Closed
lsong98sh opened this issue May 31, 2019 · 5 comments
Closed

[FEATURE] Add @Externalizable #2146

lsong98sh opened this issue May 31, 2019 · 5 comments
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.

Comments

@lsong98sh
Copy link

As it‘s name, simply generate writeExternal and readExternal for POJO.

@rspilker
Copy link
Collaborator

rspilker commented Jun 3, 2019

Without a before image (the code without lombok) and after image (the code you would write if lombok would support this) we cannot do anything.

@rspilker rspilker added the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Jun 3, 2019
@rspilker
Copy link
Collaborator

rspilker commented Jun 3, 2019

Also, please specify what would be the use case, other libraries that would consume these methods et cetera.

@mxmlnglt
Copy link

mxmlnglt commented Jun 5, 2019

The purpose of this feature is probably the auto-generation of code to implement interface java.io.Externalizable: https://docs.oracle.com/javase/8/docs/api/java/io/Externalizable.html

Example code by Baeldung: https://www.baeldung.com/java-externalizable

@lsong98sh
Copy link
Author

Sorry I'm a chinese. so I can only provide Chinese WebSite to explain Externalizable interface.
Thanks to mxmlnglt, the answer is exact what I want.

Recently, I'm working on a project that does a fast serialization job of an Java Object.
A project that almost the same as Kyro 【 https://github.com/EsotericSoftware/kryo】
But uses CgLib to generate byecode。

First, I wrote my own UnsafeBufferedOutput, and manually implememts the Externalizable interface.
The test result is about 25% faster that Kyro.
So the rest of the work can ben done in two ways. Using CgLib to generate a Proxy(somthing like BeanCopier ) or using ask Lombok to generate the source。

@rspilker
Copy link
Collaborator

We're not going to add this. Using java serialization is basically broken, so we're not going to create code to make it easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.
Projects
None yet
Development

No branches or pull requests

3 participants