flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject flink git commit: [FLINK-4677] fail if user jar contains no executions
Date Wed, 05 Oct 2016 14:10:24 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.1 a83dbaeb0 -> fddd89bcd


[FLINK-4677] fail if user jar contains no executions

This closes #2548.


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

Branch: refs/heads/release-1.1
Commit: fddd89bcd59ca836568e647594061938ab905d7d
Parents: a83dbae
Author: Maximilian Michels <mxm@apache.org>
Authored: Fri Sep 30 15:00:32 2016 +0200
Committer: Maximilian Michels <mxm@apache.org>
Committed: Wed Oct 5 16:09:43 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/client/program/ClusterClient.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/fddd89bc/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
b/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
index 2a0aca3..f5e513f 100644
--- a/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
+++ b/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
@@ -318,6 +318,10 @@ public abstract class ClusterClient {
 			try {
 				// invoke main method
 				prog.invokeInteractiveModeForExecution();
+				if (lastJobExecutionResult == null && factory.getLastEnvCreated() == null) {
+					throw new ProgramInvocationException("The program didn't contain Flink jobs. " +
+						"Perhaps you forgot to call execute() on the execution environment.");
+				}
 				if (isDetached()) {
 					// in detached mode, we execute the whole user code to extract the Flink job, afterwards
we run it here
 					return ((DetachedEnvironment) factory.getLastEnvCreated()).finalizeExecute();
@@ -332,7 +336,7 @@ public abstract class ClusterClient {
 			}
 		}
 		else {
-			throw new RuntimeException("PackagedProgram does not have a valid invocation mode.");
+			throw new ProgramInvocationException("PackagedProgram does not have a valid invocation
mode.");
 		}
 	}
 


Mime
View raw message