beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reuven...@apache.org
Subject [1/2] beam git commit: Add ability to set job labels to BEAM Java SDK
Date Mon, 11 Sep 2017 23:25:43 GMT
Repository: beam
Updated Branches:
  refs/heads/master e8bf045f6 -> 3a83a661b


Add ability to set job labels to BEAM Java SDK


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

Branch: refs/heads/master
Commit: 5b2f423d33dd98fd94898370419228ad50cdefb2
Parents: e8bf045
Author: Zongwei Zhou <zongweiz@google.com>
Authored: Wed Aug 30 17:45:34 2017 -0700
Committer: Reuven Lax <relax@relax-macbookpro2.roam.corp.google.com>
Committed: Mon Sep 11 15:59:57 2017 -0700

----------------------------------------------------------------------
 .../beam/runners/dataflow/DataflowPipelineTranslator.java   | 3 +++
 .../runners/dataflow/options/DataflowPipelineOptions.java   | 9 +++++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/5b2f423d/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
index f1783de..2bed6be 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
@@ -345,6 +345,9 @@ public class DataflowPipelineTranslator {
       workerPool.setPackages(packages);
       workerPool.setNumWorkers(options.getNumWorkers());
 
+      if (options.getLabels() != null) {
+        job.setLabels(options.getLabels());
+      }
       if (options.isStreaming()
           && !DataflowRunner.hasExperiment(options, "enable_windmill_service")) {
         // Use separate data disk for streaming.

http://git-wip-us.apache.org/repos/asf/beam/blob/5b2f423d/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java
index 4af420b..77154b5 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java
@@ -17,6 +17,8 @@
  */
 package org.apache.beam.runners.dataflow.options;
 
+import java.util.Map;
+
 import org.apache.beam.runners.dataflow.DataflowRunner;
 import org.apache.beam.sdk.annotations.Experimental;
 import org.apache.beam.sdk.extensions.gcp.options.GcpOptions;
@@ -116,6 +118,13 @@ public interface DataflowPipelineOptions
   void setRegion(String region);
 
   /**
+   * Labels that will be applied to the billing records for this job.
+   */
+  @Description("Labels that will be applied to the billing records for this job.")
+  Map<String, String> getLabels();
+  void setLabels(Map<String, String> labels);
+
+  /**
    * Returns a default staging location under {@link GcpOptions#getGcpTempLocation}.
    */
   class StagingLocationFactory implements DefaultValueFactory<String> {


Mime
View raw message