masteryhx commented on code in PR #21635:
URL: https://github.com/apache/flink/pull/21635#discussion_r1221424165
##########
flink-runtime/src/test/java/org/apache/flink/runtime/testutils/statemigration/TestType.java:
##########
@@ -200,8 +237,34 @@ public TestType deserialize(DataInputView source) throws
IOException {
@Override
public TypeSerializerSnapshot<TestType> snapshotConfiguration() {
- throw new UnsupportedOperationException(
- "This is an incompatible serializer; shouldn't be used.");
+ return new TypeSerializerSnapshot<TestType>() {
+ @Override
+ public int getCurrentVersion() {
+ return 0;
+ }
+
+ @Override
+ public void writeSnapshot(DataOutputView out) {
+ // do nothing
+ }
+
+ @Override
+ public void readSnapshot(
+ int readVersion, DataInputView in, ClassLoader
userCodeClassLoader) {
+ // do nothing
+ }
+
+ @Override
+ public TypeSerializer<TestType> restoreSerializer() {
+ return new IncompatibleTestTypeSerializer();
+ }
+
+ @Override
+ public TypeSerializerSchemaCompatibility<TestType>
resolveSchemaCompatibility(
+ TypeSerializerSnapshot<TestType>
oldSerializerSnapshot) {
+ return TypeSerializerSchemaCompatibility.incompatible();
+ }
+ };
Review Comment:
Sorry, maybe I missed something.
You mean that we should not suppose the method will be supported by all
TypeSerializers, some exceptions should be handled in the caller logic ?
--
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]