[
https://issues.apache.org/jira/browse/FLINK-11075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16709839#comment-16709839
]
ASF GitHub Bot commented on FLINK-11075:
----------------------------------------
tzulitai opened a new pull request #7243: [FLINK-11075] [core] Remove
irrelevant code in CompatibilityUtil#resolveCompatibilityResult
URL: https://github.com/apache/flink/pull/7243
## What is the purpose of the change
This PR removes irrelevant code in
`CompatibilityUtil#resolveCompatibilityResult`, after the behaviour of carrying
a covert deserializer in the compatibility result is no longer relevant since
Flink 1.7.
## Brief change log
- Since `initialResult` can only every be `compatible` or `requires
migration` and never carry a convert deserializer, it can be returned already
without further checks. The redundant checks are removed.
- Simplify the method signature after some parameters are no longer used.
## Verifying this change
This is only a code cleanup.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Remove redundant code path in CompatibilityUtil
> -----------------------------------------------
>
> Key: FLINK-11075
> URL: https://issues.apache.org/jira/browse/FLINK-11075
> Project: Flink
> Issue Type: Improvement
> Components: Type Serialization System
> Reporter: Tzu-Li (Gordon) Tai
> Assignee: Tzu-Li (Gordon) Tai
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.8.0
>
>
> In {{CompatibilityUtil#resolveCompatibilityResult}}:
> {code:java}
> CompatibilityResult<T> initialResult = resolveCompatibilityResult(
> (TypeSerializerSnapshot<T>) precedingSerializerConfigSnapshot,
> newSerializer);
> if (!initialResult.isRequiresMigration()) {
> return initialResult;
> } else {
> if (precedingSerializer != null &&
> !(precedingSerializer.getClass().equals(dummySerializerClassTag))) {
> // if the preceding serializer exists and is not a dummy, use
> // that for converting instead of any provided convert deserializer
> return CompatibilityResult.requiresMigration((TypeSerializer<T>)
> precedingSerializer);
> } else {
> // requires migration (may or may not have a convert deserializer)
> return initialResult;
> }
> {code}
> {{initialResult}} can actually be returned already, since the case where we
> try to provide a convert deserializer is no longer relevant. We do not need
> to check if a convert deserializer is provided because that will never be the
> case.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)