tzulitai commented on a change in pull request #7048: [FLINK-10809][state] 
Include keyed state that is not from head operat…
URL: https://github.com/apache/flink/pull/7048#discussion_r232559236
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/datastream/ReinterpretDataStreamAsKeyedStreamITCase.java
 ##########
 @@ -227,5 +293,22 @@ public void close() throws Exception {
                        Assert.assertEquals(expectedSum, runningSum);
                        super.close();
                }
+
+               @Override
+               public void snapshotState(FunctionSnapshotContext context) 
throws Exception {
+                       sumState.add(runningSum);
+               }
+
+               @Override
+               public void initializeState(FunctionInitializationContext 
context) throws Exception {
+                       sumState = context.getOperatorStateStore().getListState(
+                               new ListStateDescriptor<>("sumState", 
Integer.class));
+
+                       if (context.isRestored()) {
 
 Review comment:
   Where do we check whether or not we actually have restore something?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to