beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [1/2] incubator-beam git commit: Update AutoComplete.java
Date Wed, 23 Mar 2016 07:00:52 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 90af33243 -> ff8640d27


Update AutoComplete.java

Allow for the Datastore dependency of this test to be in a different project than the main
project for the job.

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

Branch: refs/heads/master
Commit: 6b0a7afd269f66fed6c44b4116b8bf06e32b10d3
Parents: 90af332
Author: sammcveety <sam.mcveety@gmail.com>
Authored: Tue Mar 22 11:58:19 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Tue Mar 22 23:59:50 2016 -0700

----------------------------------------------------------------------
 .../cloud/dataflow/examples/complete/AutoComplete.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/6b0a7afd/examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java
b/examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java
index 1bccc4a..f897338 100644
--- a/examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java
+++ b/examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java
@@ -57,6 +57,7 @@ import com.google.cloud.dataflow.sdk.values.KV;
 import com.google.cloud.dataflow.sdk.values.PBegin;
 import com.google.cloud.dataflow.sdk.values.PCollection;
 import com.google.cloud.dataflow.sdk.values.PCollectionList;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 
 import org.joda.time.Duration;
@@ -432,10 +433,14 @@ public class AutoComplete {
     Boolean getOutputToBigQuery();
     void setOutputToBigQuery(Boolean value);
 
-    @Description("Whether output to Datastoree")
+    @Description("Whether output to Datastore")
     @Default.Boolean(false)
     Boolean getOutputToDatastore();
     void setOutputToDatastore(Boolean value);
+
+    @Description("Datastore output dataset ID, defaults to project ID")
+    String getOutputDataset();
+    void setOutputDataset(String value);
   }
 
   public static void main(String[] args) throws IOException {
@@ -477,7 +482,8 @@ public class AutoComplete {
     if (options.getOutputToDatastore()) {
       toWrite
       .apply(ParDo.named("FormatForDatastore").of(new FormatForDatastore(options.getKind())))
-      .apply(DatastoreIO.writeTo(options.getProject()));
+      .apply(DatastoreIO.writeTo(MoreObjects.firstNonNull(
+          options.getOutputDataset(), options.getProject())));
     }
     if (options.getOutputToBigQuery()) {
       dataflowUtils.setupBigQueryTable();


Mime
View raw message