Myasuka commented on a change in pull request #17525:
URL: https://github.com/apache/flink/pull/17525#discussion_r741597480
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBRocksStateKeysAndNamespacesIteratorTest.java
##########
@@ -129,4 +131,74 @@ public void testIterator() throws Exception {
}
}
}
+
+ @Test
+ public void testIteratorUpdateMapStateMultipleTimes() throws Exception {
Review comment:
First of all, this test has many code same as `#testIteratorHelper`.
Secondly, I think we should add new test in `StateBackendTestBase` to verify
all state-backends.
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java
##########
@@ -460,22 +461,66 @@ public void testGetKeysAndNamespaces() throws Exception {
backend.getPartitionedState(
ns1,
StringSerializer.INSTANCE,
- new ValueStateDescriptor<>(fieldName,
IntSerializer.INSTANCE));
+ new ValueStateDescriptor<>(
+ valueStateFieldName,
IntSerializer.INSTANCE));
+
+ MapState<Integer, Integer> keyedState2 =
Review comment:
I think modify existing test is okay, however, I don't we should
introduce so much code duplication.
I think you could leverage `backend.createInternalState` API which could set
current namespace of `ns1` or `ns2`.
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBRocksStateKeysAndNamespacesIteratorTest.java
##########
@@ -129,4 +131,74 @@ public void testIterator() throws Exception {
}
}
}
+
+ @Test
+ public void testIteratorUpdateMapStateMultipleTimes() throws Exception {
Review comment:
First of all, this test has many code same as `#testIteratorHelper`.
Secondly, I think we should add new test in `StateBackendTestBase` to verify
all state-backends.
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java
##########
@@ -460,22 +461,66 @@ public void testGetKeysAndNamespaces() throws Exception {
backend.getPartitionedState(
ns1,
StringSerializer.INSTANCE,
- new ValueStateDescriptor<>(fieldName,
IntSerializer.INSTANCE));
+ new ValueStateDescriptor<>(
+ valueStateFieldName,
IntSerializer.INSTANCE));
+
+ MapState<Integer, Integer> keyedState2 =
Review comment:
I think modify existing test is okay, however, I don't we should
introduce so much code duplication.
I think you could leverage `backend.createInternalState` API which could set
current namespace of `ns1` or `ns2`.
--
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]