rkhachatryan commented on code in PR #19679: URL: https://github.com/apache/flink/pull/19679#discussion_r936501443
########## flink-state-backends/flink-statebackend-changelog/src/test/java/org/apache/flink/state/changelog/ChangelogStateBackendMigrationTest.java: ########## @@ -0,0 +1,68 @@ +/* + * 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.flink.state.changelog; + +import org.apache.flink.contrib.streaming.state.EmbeddedRocksDBStateBackend; +import org.apache.flink.runtime.state.AbstractStateBackend; +import org.apache.flink.runtime.state.CheckpointStorage; +import org.apache.flink.runtime.state.StateBackendMigrationTestBase; +import org.apache.flink.runtime.state.hashmap.HashMapStateBackend; +import org.apache.flink.runtime.state.storage.JobManagerCheckpointStorage; + +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; + +/** Tests for the partitioned state part of {@link ChangelogStateBackend}. */ +@RunWith(Parameterized.class) +public class ChangelogStateBackendMigrationTest + extends StateBackendMigrationTestBase<ChangelogStateBackend> { + + @Parameterized.Parameters + public static List<Supplier<AbstractStateBackend>> modes() { + return Arrays.asList( + HashMapStateBackend::new, + () -> new EmbeddedRocksDBStateBackend(false), + () -> new EmbeddedRocksDBStateBackend(true)); + } + + @Parameterized.Parameter public Supplier<AbstractStateBackend> delegatedStateBackendSupplier; + + @Override + protected ChangelogStateBackend getStateBackend() throws Exception { + return new ChangelogStateBackend(delegatedStateBackendSupplier.get()); + } + + @Override + protected CheckpointStorage getCheckpointStorage() { + return new JobManagerCheckpointStorage(); + } + + @Override + public void testStateBackendRestoreFailsIfNewKeySerializerIsIncompatible() {} + + @Override + public void testStateBackendRestoreFailsIfNewKeySerializerRequiresMigration() {} + + @Override + public void testStateBackendRestoreSucceedsIfNewKeySerializerRequiresReconfiguration() {} Review Comment: I think it would be nice to have such a check, but I don't think it's strictly mandatory at this point. If not, - I'd create a ticket for that - mention the ticket in the comments (in the test) - probably use assumptions similar to [these](https://github.com/apache/flink/blob/8c6a9e58f1ebd9f1804498df490e5c9bd343c304/flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java#L878) which makes it self-documenting WDYT? -- 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]
