beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [16/50] [abbrv] incubator-beam git commit: DataflowRunner: reject job submission when the version has not been properly set
Date Tue, 06 Dec 2016 16:41:06 GMT
DataflowRunner: reject job submission when the version has not been properly set


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

Branch: refs/heads/gearpump-runner
Commit: 8fd520c07e464c4308d8d32cc0e88e2ecd96c8d2
Parents: 7ad7877
Author: Dan Halperin <dhalperi@google.com>
Authored: Thu Dec 1 11:21:30 2016 -0800
Committer: Dan Halperin <dhalperi@google.com>
Committed: Fri Dec 2 09:17:11 2016 -0800

----------------------------------------------------------------------
 .../org/apache/beam/runners/dataflow/DataflowRunner.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8fd520c0/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
index 6ed386a..0357b46 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
@@ -513,10 +513,14 @@ public class DataflowRunner extends PipelineRunner<DataflowPipelineJob>
{
     Job newJob = jobSpecification.getJob();
     newJob.setClientRequestId(requestId);
 
-    String version = ReleaseInfo.getReleaseInfo().getVersion();
+    ReleaseInfo releaseInfo = ReleaseInfo.getReleaseInfo();
+    String version = releaseInfo.getVersion();
+    checkState(
+        !version.equals("${pom.version}"),
+        "Unable to submit a job to the Dataflow service with unset version ${pom.version}");
     System.out.println("Dataflow SDK version: " + version);
 
-    newJob.getEnvironment().setUserAgent(ReleaseInfo.getReleaseInfo());
+    newJob.getEnvironment().setUserAgent(releaseInfo);
     // The Dataflow Service may write to the temporary directory directly, so
     // must be verified.
     if (!isNullOrEmpty(options.getGcpTempLocation())) {


Mime
View raw message