1996fanrui commented on code in PR #21635:
URL: https://github.com/apache/flink/pull/21635#discussion_r1402925601
##########
docs/content.zh/docs/dev/datastream/fault-tolerance/serialization/custom_serialization.md:
##########
@@ -442,4 +445,23 @@ migrate from the old abstractions. The steps to do this is
as follows:
`TypeSerializerConfigSnapshot` implementation as will as the
`TypeSerializer#ensureCompatibility(TypeSerializerConfigSnapshot)` from the
serializer).
+## Migrating from deprecated
`TypeSerializerSnapshot#resolveSchemaCompatibility(TypeSerializer
newSerializer)` before Flink 1.18
Review Comment:
```suggestion
## Migrating from deprecated
`TypeSerializerSnapshot#resolveSchemaCompatibility(TypeSerializer
newSerializer)` before Flink 1.19
```
And this part has a series of 1.18
##########
docs/content/docs/dev/datastream/fault-tolerance/serialization/custom_serialization.md:
##########
@@ -345,12 +345,15 @@ public final class GenericArraySerializerSnapshot<C>
extends CompositeTypeSerial
this.componentClass = InstantiationUtil.resolveClassByName(in,
userCodeClassLoader);
}
- @Override
- protected boolean resolveOuterSchemaCompatibility(GenericArraySerializer
newSerializer) {
- return (this.componentClass == newSerializer.getComponentClass())
- ? OuterSchemaCompatibility.COMPATIBLE_AS_IS
- : OuterSchemaCompatibility.INCOMPATIBLE;
- }
+ @Override
+ protected OuterSchemaCompatibility resolveOuterSchemaCompatibility(
+ TypeSerializerSnapshot<C[]> oldSerializerSnapshot) {
+ GenericArraySerializerSnapshot<C[]>
oldGenericArraySerializerSnapshot =
+ (GenericArraySerializerSnapshot<C[]>)
oldSerializerSnapshot;
+ return (this.componentClass ==
oldGenericArraySerializerSnapshot.componentClass)
+ ? OuterSchemaCompatibility.COMPATIBLE_AS_IS
+ : OuterSchemaCompatibility.INCOMPATIBLE;
+ }
Review Comment:
Same comment: we should use 4 spaces instead of tab.
##########
docs/content.zh/docs/dev/datastream/fault-tolerance/serialization/custom_serialization.md:
##########
@@ -342,12 +342,15 @@ public final class GenericArraySerializerSnapshot<C>
extends CompositeTypeSerial
this.componentClass = InstantiationUtil.resolveClassByName(in,
userCodeClassLoader);
}
- @Override
- protected boolean resolveOuterSchemaCompatibility(GenericArraySerializer
newSerializer) {
- return (this.componentClass == newSerializer.getComponentClass())
- ? OuterSchemaCompatibility.COMPATIBLE_AS_IS
- : OuterSchemaCompatibility.INCOMPATIBLE;
- }
+ @Override
+ protected OuterSchemaCompatibility resolveOuterSchemaCompatibility(
+ TypeSerializerSnapshot<C[]> oldSerializerSnapshot) {
+ GenericArraySerializerSnapshot<C[]>
oldGenericArraySerializerSnapshot =
+ (GenericArraySerializerSnapshot<C[]>)
oldSerializerSnapshot;
+ return (this.componentClass ==
oldGenericArraySerializerSnapshot.componentClass)
+ ? OuterSchemaCompatibility.COMPATIBLE_AS_IS
+ : OuterSchemaCompatibility.INCOMPATIBLE;
+ }
Review Comment:
keep the code style are same. We should use 4 spaces instead of tab.
##########
flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerUtil.java:
##########
@@ -34,21 +34,21 @@ public class CompositeTypeSerializerUtil {
* can be used by legacy snapshot classes, which have a newer
implementation implemented as a
* {@link CompositeTypeSerializerSnapshot}.
*
- * @param newSerializer the new serializer to check for compatibility.
+ * @param legacySerializerSnapshot the legacy serializer snapshot to check
for compatibility.
* @param newCompositeSnapshot an instance of the new snapshot class to
delegate compatibility
* checks to. This instance should already contain the outer snapshot
information.
* @param legacyNestedSnapshots the nested serializer snapshots of the
legacy composite
* snapshot.
* @return the result compatibility.
*/
public static <T> TypeSerializerSchemaCompatibility<T>
delegateCompatibilityCheckToNewSnapshot(
- TypeSerializer<T> newSerializer,
- CompositeTypeSerializerSnapshot<T, ? extends TypeSerializer>
newCompositeSnapshot,
+ TypeSerializerSnapshot<T> legacySerializerSnapshot,
Review Comment:
It use the `legacy` as the name prefix, and the caller uses `old` as the
prefix.
I see most of your changes use `old` or `previous` as the prefix, should we
unify them?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]