flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StefanRRichter <...@git.apache.org>
Subject [GitHub] flink pull request #3074: [FLINK-5421] Explicit restore method in Snapshotab...
Date Wed, 11 Jan 2017 14:36:35 GMT
Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3074#discussion_r95589363
  
    --- 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 --
    
    Agreed. Will simplify the test accordingly.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message