Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3074#discussion_r95588497
  
    --- Diff: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/InterruptSensitiveRestoreTest.java
 ---
    @@ -280,4 +368,50 @@ public void restoreState(Serializable state) throws 
Exception {
                        fail("should never be called");
                }
        }
    +
    +   private static class TestSourceOperator implements 
SourceFunction<Object>, CheckpointedFunction {
    +           private static final long serialVersionUID = 1L;
    +
    +           @Override
    +           public void run(SourceContext<Object> ctx) throws Exception {
    +                   fail("should never be called");
    +           }
    +
    +           @Override
    +           public void cancel() {}
    +
    +
    +           @Override
    +           public void snapshotState(FunctionSnapshotContext context) 
throws Exception {
    +                   fail("should never be called");
    +           }
    +
    +           @Override
    +           public void initializeState(FunctionInitializationContext 
context) throws Exception {
    +                   
((StateInitializationContext)context).getRawOperatorStateInputs().iterator().next().getStream().read();
    +           }
    +   }
    +
    +   private static class TestSourceKeyed implements SourceFunction<Object>, 
CheckpointedFunction {
    +           private static final long serialVersionUID = 1L;
    +
    +           @Override
    +           public void run(SourceContext<Object> ctx) throws Exception {
    +                   fail("should never be called");
    +           }
    +
    +           @Override
    +           public void cancel() {}
    +
    +
    +           @Override
    +           public void snapshotState(FunctionSnapshotContext context) 
throws Exception {
    +                   fail("should never be called");
    +           }
    +
    +           @Override
    +           public void initializeState(FunctionInitializationContext 
context) throws Exception {
    +                   
((StateInitializationContext)context).getRawKeyedStateInputs().iterator().next().getStream().read();
    --- End diff --
    
    Even with this line commented out the tests still succeed. Probably because 
the `AbstractStreamOperator` already tries reading from the keyed streams. What 
do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to