flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [3/3] git commit: Improve error messages for data sinks inside iterations.
Date Sat, 12 Jul 2014 17:32:17 GMT
Improve error messages for data sinks inside iterations.


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

Branch: refs/heads/master
Commit: a82248617fa560a97a9f097346ef0104a463b1c1
Parents: ca4e7b4
Author: Stephan Ewen <sewen@apache.org>
Authored: Fri Jul 11 17:45:45 2014 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Sat Jul 12 19:31:26 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/compiler/PactCompiler.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/a8224861/flink-compiler/src/main/java/org/apache/flink/compiler/PactCompiler.java
----------------------------------------------------------------------
diff --git a/flink-compiler/src/main/java/org/apache/flink/compiler/PactCompiler.java b/flink-compiler/src/main/java/org/apache/flink/compiler/PactCompiler.java
index 1ee1413..b55dea0 100644
--- a/flink-compiler/src/main/java/org/apache/flink/compiler/PactCompiler.java
+++ b/flink-compiler/src/main/java/org/apache/flink/compiler/PactCompiler.java
@@ -31,6 +31,7 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.flink.api.common.InvalidProgramException;
 import org.apache.flink.api.common.Plan;
 import org.apache.flink.api.common.operators.Operator;
 import org.apache.flink.api.common.operators.Union;
@@ -704,6 +705,10 @@ public class PactCompiler {
 				n = new BinaryUnionNode((Union<?>) c);
 			}
 			else if (c instanceof PartialSolutionPlaceHolder) {
+				if (this.parent == null) {
+					throw new InvalidProgramException("It is currently not supported to create data sinks
inside iterations.");
+				}
+				
 				final PartialSolutionPlaceHolder<?> holder = (PartialSolutionPlaceHolder<?>)
c;
 				final BulkIterationBase<?> enclosingIteration = holder.getContainingBulkIteration();
 				final BulkIterationNode containingIterationNode =
@@ -715,6 +720,10 @@ public class PactCompiler {
 				n = p;
 			}
 			else if (c instanceof WorksetPlaceHolder) {
+				if (this.parent == null) {
+					throw new InvalidProgramException("It is currently not supported to create data sinks
inside iterations.");
+				}
+				
 				final WorksetPlaceHolder<?> holder = (WorksetPlaceHolder<?>) c;
 				final DeltaIterationBase<?, ?> enclosingIteration = holder.getContainingWorksetIteration();
 				final WorksetIterationNode containingIterationNode =
@@ -726,6 +735,10 @@ public class PactCompiler {
 				n = p;
 			}
 			else if (c instanceof SolutionSetPlaceHolder) {
+				if (this.parent == null) {
+					throw new InvalidProgramException("It is currently not supported to create data sinks
inside iterations.");
+				}
+				
 				final SolutionSetPlaceHolder<?> holder = (SolutionSetPlaceHolder<?>) c;
 				final DeltaIterationBase<?, ?> enclosingIteration = holder.getContainingWorksetIteration();
 				final WorksetIterationNode containingIterationNode =


Mime
View raw message