Skip to content

Conversation

@X-czh
Copy link
Contributor

@X-czh X-czh commented Jan 23, 2024

What is the purpose of the change

Introduce unified serialization config option for all Kryo, POJO and customized serializers for parameterized serialization config based on pure config.

Brief change log

  1. Introduce pipeline.serialization-config, a unified serialization config option for all Kryo, POJO and customized serializers.
  2. For POJO & Kryo serializers, the config is parsed and dispatched to the existing SerializerConfig#registerPojoType, SerializerConfig#registerKryoType, SerializerConfig#addDefaultKryoSerializer, and SerializerConfig#registerTypeWithKryoSerializer methods.
  3. For customized serializers, the specified type info factories is registered in the global static factory map of TypeExtractor for now so that it can be accessed from the static methods of TypeExtractor where SerializerConfig is currently not accessible. Plan to migrate the static methods to take SerializerConfig as one of the arguments in v1.20.

Verifying this change

Added tests in SerializerConfigTest on parsing different types of serializer config, both legal and illegal.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no) no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no) yes
  • The serializers: (yes / no / don't know) yes
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know) no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
  • The S3 file system connector: (yes / no / don't know) no

Documentation

  • Does this pull request introduce a new feature? (yes / no) yes
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) docs

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 23, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@X-czh
Copy link
Contributor Author

X-czh commented Jan 24, 2024

@reswqa Could you help review it? Thx~

Copy link
Contributor

@JunRuiLee JunRuiLee left a comment

Choose a reason for hiding this comment

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

Thanks @X-czh for contribution, I've left three minor comment. PTAL.

Copy link
Member

@reswqa reswqa left a comment

Choose a reason for hiding this comment

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

Thanks @X-czh, overall looks good to me. I only left a few comments. We need to manually verify that the previous and current way both work.

+ " sure that only tags are written.")
.build());

public static final ConfigOption<Map<String, String>> SERIALIZATION_CONFIG =
Copy link
Member

Choose a reason for hiding this comment

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

Could you please post a screenshot corresponding to the rendered config option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Member

@reswqa reswqa left a comment

Choose a reason for hiding this comment

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

Thanks for the update. +1 for merging.

Copy link
Contributor

@JunRuiLee JunRuiLee left a comment

Choose a reason for hiding this comment

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

LGTM

@X-czh
Copy link
Contributor Author

X-czh commented Jan 24, 2024

Thanks for the update. +1 for merging.

From the unstable UT, I just realized that the config option has to be a list of pairs instead of a map of pairs since the registration order is important for POJO and Kryo serializers. I'll append a fix commit

@X-czh X-czh changed the title [FLINK-34120] Introduce unified serialization config option for all Kryo, POJO and customized serializers [FLINK-34120][core] Introduce unified serialization config option for all Kryo, POJO and customized serializers Jan 24, 2024
@X-czh
Copy link
Contributor Author

X-czh commented Jan 24, 2024

Updated option description: image

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.

4 participants