dmvk commented on code in PR #30197: URL: https://github.com/apache/beam/pull/30197#discussion_r1476513018
########## runners/flink/1.16/build.gradle: ########## @@ -17,14 +17,19 @@ */ def basePath = '..' +def addedVersions = ["1.12", "1.13", "1.14", "1.15"] Review Comment: nit: `previousVersions` might be slightly more explicit ########## runners/flink/1.17/src/main/java/org/apache/beam/runners/flink/translation/types/compat/UnversionedTypeSerializerSnapshot.java: ########## @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.runners.flink.translation.types.compat; + +import java.io.IOException; +import org.apache.beam.runners.flink.translation.types.CoderTypeSerializer; +import org.apache.beam.sdk.util.SerializableUtils; +import org.apache.flink.api.common.typeutils.TypeSerializer; +import org.apache.flink.api.common.typeutils.TypeSerializerSchemaCompatibility; +import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot; +import org.apache.flink.core.memory.DataInputView; +import org.apache.flink.core.memory.DataOutputView; + +/** A legacy snapshot which does not care about schema compatibility. */ +@SuppressWarnings("allcheckers") +public class UnversionedTypeSerializerSnapshot<T> implements TypeSerializerSnapshot<T> { + + private CoderTypeSerializer<T> serializer = null; + + /** Needs to be public to work with {@link VersionedIOReadableWritable}. */ + public UnversionedTypeSerializerSnapshot() {} + + @SuppressWarnings("initialization") + public UnversionedTypeSerializerSnapshot(CoderTypeSerializer<T> serializer) { + this.serializer = serializer; + } + + @Override + public int getCurrentVersion() { + // We always return the same version + return 1; + } + + @Override + public void writeSnapshot(DataOutputView dataOutputView) throws IOException { Review Comment: I assume this class was introduced because `TypeSerializerConfigSnapshot` no longer exists. Should we rather bring the old class in to eliminate the risk (eg. restoring snapshots from the same version)? By quickly checking the code, it mosly delegates the logic to `TypeSerializerSnapshotSerializationUtil` which still exists 🤔 https://github.com/apache/flink/blob/release-1.16.3/flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerConfigSnapshot.java -- 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]
