flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljos...@apache.org
Subject flink git commit: [FLINK-5292] Add savepointToFile in OneInputStreamOperatorTestHarness.
Date Fri, 16 Dec 2016 13:17:55 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.1 a8b415fdf -> d31c9fac7


[FLINK-5292] Add savepointToFile in OneInputStreamOperatorTestHarness.

This will be used mainly for migration testing purposes between
Flink 1.1 and Flink 1.2.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/d31c9fac
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/d31c9fac
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/d31c9fac

Branch: refs/heads/release-1.1
Commit: d31c9fac740fdede845cd83730ffc8089e62da17
Parents: a8b415f
Author: kl0u <kkloudas@gmail.com>
Authored: Wed Dec 14 16:17:37 2016 +0100
Committer: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Committed: Fri Dec 16 14:16:22 2016 +0100

----------------------------------------------------------------------
 .../streaming/util/OneInputStreamOperatorTestHarness.java   | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d31c9fac/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/OneInputStreamOperatorTestHarness.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/OneInputStreamOperatorTestHarness.java
b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/OneInputStreamOperatorTestHarness.java
index 12acfb6..b97b2cf 100644
--- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/OneInputStreamOperatorTestHarness.java
+++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/OneInputStreamOperatorTestHarness.java
@@ -46,6 +46,8 @@ import org.apache.flink.streaming.runtime.tasks.TimeServiceProvider;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
+import java.io.FileOutputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.HashMap;
@@ -250,6 +252,13 @@ public class OneInputStreamOperatorTestHarness<IN, OUT> {
 		}
 		return snapshot;
 	}
+	
+	public void snaphotToFile(StreamTaskState snapshot, String filename) throws Exception {
+		FileOutputStream out = new FileOutputStream(filename);
+		ObjectOutputStream oos = new ObjectOutputStream(out);
+		oos.writeObject(snapshot);
+		out.close();
+	}
 
 	/**
 	 * Calls {@link org.apache.flink.streaming.api.operators.StreamOperator#restoreState(StreamTaskState)}
()}


Mime
View raw message