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

feat(java): support deserialization ignoreEnumDeserializeError #1623

Merged
merged 3 commits into from
May 11, 2024

Conversation

weijiang157152688
Copy link
Contributor

@weijiang157152688 weijiang157152688 commented May 10, 2024

What does this PR do?

Related issues

Does this PR introduce any user-facing change?

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

Benchmark

@weijiang157152688 weijiang157152688 changed the title ignoreEnumDeserializeError Enumerating new values, deserializing without any new enumerations, resulting in the array being out of bounds and unable to parse properly bug feat(java): ignoreEnumDeserializeError deserializing without any new enumerations, resulting in the array being out of bounds and unable to parse properly bug May 10, 2024
@weijiang157152688 weijiang157152688 changed the title feat(java): ignoreEnumDeserializeError deserializing without any new enumerations, resulting in the array being out of bounds and unable to parse properly bug feat(java): ignoreEnumDeserializeError May 10, 2024
@weijiang157152688 weijiang157152688 changed the title feat(java): ignoreEnumDeserializeError feat(java): support deserialization ignoreEnumDeserializeError May 10, 2024
@weijiang157152688 weijiang157152688 changed the title feat(java): support deserialization ignoreEnumDeserializeError feat(java): support deserialization ignoreEnumDeserializeError May 10, 2024
@@ -54,6 +54,7 @@ public class Config implements Serializable {
private final boolean deserializeUnexistedClass;
private final boolean scalaOptimizationEnabled;
private transient int configHash;
private final boolean enumDeserializeErrorIgnored;
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about naming it as deserializeUnexistentEnumValueAsNull

@@ -49,7 +49,7 @@ public void write(MemoryBuffer buffer, Enum value) {
@Override
public Enum read(MemoryBuffer buffer) {
int value = buffer.readVarUint32Small7();
if (fury.getConfig().isEnumDeserializeErrorIgnored() && value >= enumConstants.length) {
if (fury.getConfig().isDeserializeUnexistentEnumValueAsNull() && value >= enumConstants.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (fury.getConfig().isDeserializeUnexistentEnumValueAsNull() && value >= enumConstants.length) {
if (fury.getConfig().deserializeUnexistentEnumValueAsNull() && value >= enumConstants.length) {

ci/format.sh Outdated
@@ -25,6 +25,8 @@ install_nodejs() {
node -v
npm -v
}
export python=/home/t5/weijiang/work/score/fury/1/Python-3.8.18/python3.8/bin/python3.8
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this

ci/format.sh Outdated
@@ -180,7 +182,7 @@ format_all_scripts() {
}

format_java() {
if command -v mvn >/dev/null ; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert this

@@ -100,6 +102,10 @@ public boolean isStringRefIgnored() {
return stringRefIgnored;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add Javadoc here

@@ -100,6 +102,10 @@ public boolean isStringRefIgnored() {
return stringRefIgnored;
}

public boolean isDeserializeUnexistentEnumValueAsNull() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to deserializeUnexistentEnumValueAsNull

Copy link
Collaborator

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

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

LGTM

@chaokunyang chaokunyang merged commit 4de1623 into apache:main May 11, 2024
32 checks passed
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.

3 participants