tzulitai commented on a change in pull request #8570: [FLINK-12688] [state]
Make serializer lazy initialization thread safe in StateDescriptor
URL: https://github.com/apache/flink/pull/8570#discussion_r289262617
##########
File path:
flink-core/src/test/java/org/apache/flink/api/common/state/StateDescriptorTest.java
##########
@@ -200,6 +204,31 @@ public void testEqualsSameNameAndTypeDifferentClass()
throws Exception {
assertNotEquals(descr1, descr2);
}
+ @Test
+ public void testSerializerLazyInitializeInParallel() throws Exception {
+ final String name = "testSerializerLazyInitializeInParallel";
+ // use PojoTypeInfo which will create a new serializer when
createSerializer is invoked.
+ final TestStateDescriptor<String> desc =
+ new TestStateDescriptor<>(name, new
PojoTypeInfo<>(String.class, new ArrayList<>()));
+ final int threadNumber = 20;
+ final ArrayList<Thread> threads = new ArrayList<>(threadNumber);
+ final ExecutionConfig executionConfig =
Mockito.mock(ExecutionConfig.class);
Review comment:
No need to use mockito here. `new ExecutionConfig()` would suffice.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services