Skip to content

Core: ensure Kryo serializability of MetricsConfig#3702

Merged
jackye1995 merged 2 commits intoapache:masterfrom
jackye1995:metrics-config-kryo
Dec 10, 2021
Merged

Core: ensure Kryo serializability of MetricsConfig#3702
jackye1995 merged 2 commits intoapache:masterfrom
jackye1995:metrics-config-kryo

Conversation

@jackye1995
Copy link
Contributor

In #3638 , we improved MetricsConfig construction and marked it as immutable. As @aokolnychyi pointed out the class was used for serialization before we introduced SerializableTable. Although it is not likely that people are still serializing the metrics config, because it implements the Serializable interface, it's still safer to use SerializableMap instead of ImmutableMap for this to avoid any potential trouble.


private static final MetricsConfig DEFAULT = new MetricsConfig(ImmutableMap.of(),
MetricsModes.fromString(DEFAULT_WRITE_METRICS_MODE_DEFAULT));
MetricsModes.fromString(DEFAULT_WRITE_METRICS_MODE_DEFAULT));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indentation was off, also fixed along the way

@jackye1995 jackye1995 added this to the Iceberg 0.13.0 Release milestone Dec 9, 2021
Copy link
Contributor

@kbendick kbendick left a comment

Choose a reason for hiding this comment

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

LGTM.

Should we add a test to roundtrip MetricsConfig with the kryo serializer and the java serializer?

@rdblue
Copy link
Contributor

rdblue commented Dec 10, 2021

Thanks, @jackye1995!

@jackye1995
Copy link
Contributor Author

Thanks for the reviews!

@jackye1995 jackye1995 merged commit 565724f into apache:master Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants