Skip to content

Conversation

shuyufang
Copy link

…ullClassInfo

What does this PR do?

we has some scene , after the class with the upstream system serialized, the downstream system can not deserialize without the class object, but current .withDeserializeNonexistentClass write the full class info. we want fury support deserialize object when none local class can deserializeNonexistentClassNotWriteFullClassInfo feature

Related issues

Does this PR introduce any user-facing change?

Benchmark

@shuyufang shuyufang changed the title 【Java】add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature 【feat】【Java】add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature Nov 7, 2024
@shuyufang shuyufang changed the title 【feat】【Java】add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature feat:【Java】add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature Nov 7, 2024
@shuyufang shuyufang changed the title feat:【Java】add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature feat: add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature (#1931 ) Nov 7, 2024
@chaokunyang chaokunyang changed the title feat: add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature (#1931 ) feat(java): add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature (#1931 ) Nov 7, 2024
@shuyufang shuyufang changed the title feat(java): add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature (#1931 ) feat(java): add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature Nov 7, 2024
ClassFieldsInfo fieldsInfo = getClassFieldsInfo(classDef);
ObjectSerializer.FinalTypeField[] finalFields = fieldsInfo.finalFields;
boolean[] isFinal = fieldsInfo.isFinal;
Config config = fury.getConfig();
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 get the option here, and pass that flag to getFileName method

if (index < 0) {
return qualifiedFieldName;
}
return qualifiedFieldName.substring(index + 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create a new string everytime for deserialization, which is very slow. A better method is rename fieldInfo#qualifiedFieldName into fieldInfo#fieldName, and build it as qualified based on the option.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we should skip duplicated field name in super class if this option is enabled

@chaokunyang
Copy link
Collaborator

chaokunyang commented Nov 11, 2024

@shuyufang Seems we can refactor ClassDef#FieldInfo#qualifiedFieldName into fieldName, and only add classname when parent class has duplicate field with subclass. In this way, we can skip add a new option. Would you like to refactor along this way?

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