flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [3/3] flink git commit: [tests fix] Fix runtime exceptions for large record sorter by properly mocking the environment.
Date Wed, 11 Feb 2015 19:43:25 GMT
[tests fix] Fix runtime exceptions for large record sorter by properly mocking the environment.


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

Branch: refs/heads/master
Commit: 18c9082cda7f19ae7556e9aaa8caab08a48e9596
Parents: 90834ca
Author: Stephan Ewen <sewen@apache.org>
Authored: Wed Feb 11 19:10:17 2015 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Wed Feb 11 20:42:43 2015 +0100

----------------------------------------------------------------------
 .../jobgraph/tasks/AbstractInvokable.java       |  8 ++---
 .../operators/testutils/DummyInvokable.java     | 34 ++++++++++++++++++--
 2 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/18c9082c/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
index 42bbe3c..e7e9de6 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
@@ -86,7 +86,7 @@ public abstract class AbstractInvokable {
 	 * 
 	 * @return the current number of subtasks the respective task is split into
 	 */
-	public final int getCurrentNumberOfSubtasks() {
+	public int getCurrentNumberOfSubtasks() {
 		return this.environment.getNumberOfSubtasks();
 	}
 
@@ -95,7 +95,7 @@ public abstract class AbstractInvokable {
 	 * 
 	 * @return the index of this subtask in the subtask group
 	 */
-	public final int getIndexInSubtaskGroup() {
+	public int getIndexInSubtaskGroup() {
 		return this.environment.getIndexInSubtaskGroup();
 	}
 
@@ -104,7 +104,7 @@ public abstract class AbstractInvokable {
 	 * 
 	 * @return the task configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.AbstractJobVertex}
 	 */
-	public final Configuration getTaskConfiguration() {
+	public Configuration getTaskConfiguration() {
 		return this.environment.getTaskConfiguration();
 	}
 
@@ -113,7 +113,7 @@ public abstract class AbstractInvokable {
 	 * 
 	 * @return the job configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.JobGraph}
 	 */
-	public final Configuration getJobConfiguration() {
+	public Configuration getJobConfiguration() {
 		return this.environment.getJobConfiguration();
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/18c9082c/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/DummyInvokable.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/DummyInvokable.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/DummyInvokable.java
index ef3f60c..5e99cf4 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/DummyInvokable.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/DummyInvokable.java
@@ -16,10 +16,12 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.runtime.operators.testutils;
 
+import org.apache.flink.api.common.ExecutionConfig;
+import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
+import org.apache.flink.util.InstantiationUtil;
 
 /**
  * An invokable that does nothing.
@@ -29,7 +31,35 @@ public class DummyInvokable extends AbstractInvokable {
 	@Override
 	public void registerInputOutput() {}
 
+	@Override
+	public void invoke() {}
+
+	public ClassLoader getUserCodeClassLoader() {
+		return getClass().getClassLoader();
+	}
+
+	@Override
+	public int getCurrentNumberOfSubtasks() {
+		return 1;
+	}
+
+	@Override
+	public int getIndexInSubtaskGroup() {
+		return 0;
+	}
+
+	@Override
+	public final Configuration getTaskConfiguration() {
+		return new Configuration();
+	}
+
+	@Override
+	public final Configuration getJobConfiguration() {
+		return new Configuration();
+	}
 
 	@Override
-	public void invoke() throws Exception {}
+	public ExecutionConfig getExecutionConfig() {
+		return new ExecutionConfig();
+	}
 }


Mime
View raw message