davidradl commented on code in PR #26364:
URL: https://github.com/apache/flink/pull/26364#discussion_r2016992120


##########
flink-runtime/src/test/java/org/apache/flink/runtime/state/v2/RegisteredKeyValueStateBackendMetaInfoV2Test.java:
##########
@@ -0,0 +1,199 @@
+/*
+ * 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.runtime.state.v2;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.api.common.typeutils.base.DoubleSerializer;
+import org.apache.flink.api.common.typeutils.base.IntSerializer;
+import org.apache.flink.api.common.typeutils.base.LongSerializer;
+import org.apache.flink.api.common.typeutils.base.StringSerializer;
+import org.apache.flink.core.memory.ByteArrayInputStreamWithPos;
+import org.apache.flink.core.memory.ByteArrayOutputStreamWithPos;
+import org.apache.flink.core.memory.DataInputViewStreamWrapper;
+import org.apache.flink.core.memory.DataOutputViewStreamWrapper;
+import org.apache.flink.runtime.state.KeyedBackendSerializationProxy;
+import org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class RegisteredKeyValueStateBackendMetaInfoV2Test {
+    @Test
+    void testRegisteredKeyValueStateBackendMetaInfoV2SerializationRoundtrip() 
throws Exception {
+
+        TypeSerializer<?> keySerializer = IntSerializer.INSTANCE;
+        TypeSerializer<?> namespaceSerializer = LongSerializer.INSTANCE;
+        TypeSerializer<?> stateSerializer = DoubleSerializer.INSTANCE;
+        TypeSerializer<?> userKeySerializer = StringSerializer.INSTANCE;

Review Comment:
   I could be misunderstanding. I read the Jira as "If MapState is used and the 
schema of userKey has changes, StateBackend cannot determine if it is 
compatible. So we need to add the information of userKeySeriailzer in 
org.apache.link.runtime.state.v2.RegisteredKeyValueStateBackendMetaInfo", but 
in the tests I only see  userKeySerializer set to `StringSerializer.INSTANCE`. 
Can we have a test where the userKeySerializer changes from one type to 
another. I assume non-Strings are allowed as map key types - which is why we 
cannot assume it is a String serializer.    



-- 
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]

Reply via email to