You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ch...@apache.org on 2019/03/25 16:53:56 UTC

[beam] branch master updated: Improve docs on SpannerWriteResult.

This is an automated email from the ASF dual-hosted git repository.

chamikara pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new c6d38fa  Improve docs on SpannerWriteResult.
     new 0248633  Merge pull request #8097: Improve docs on SpannerWriteResult.
c6d38fa is described below

commit c6d38fa31afa7de4f28abe1c901083bf21c43422
Author: Niel Markwick <ni...@users.noreply.github.com>
AuthorDate: Wed Mar 20 10:20:37 2019 +0100

    Improve docs on SpannerWriteResult.
    
    Add a note that the output PCollection in SpannerWriteResult will only
    work in Batch pipelines
---
 .../java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java  |  5 ++++-
 .../apache/beam/sdk/io/gcp/spanner/SpannerWriteResult.java  | 13 ++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java
index c847648..d2369b8 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java
@@ -169,7 +169,10 @@ import org.slf4j.LoggerFactory;
  *
  * The {@link SpannerWriteResult SpannerWriteResult} object contains the results of the transform,
  * including a {@link PCollection} of MutationGroups that failed to write, and a {@link PCollection}
- * that can be used as a completion signal.
+ * that can be used in batch pipelines as a completion signal to {@link
+ * org.apache.beam.sdk.transforms.Wait Wait.OnSignal} to indicate when all input has been written.
+ * Note that in streaming pipelines, this signal will never be triggered as the input is unbounded
+ * and this {@link PCollection} is using the {@link GlobalWindow}.
  *
  * <h3>Batching</h3>
  *
diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteResult.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteResult.java
index 6293aea..77587fe 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteResult.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteResult.java
@@ -28,9 +28,16 @@ import org.apache.beam.sdk.values.TupleTag;
 import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
 
 /**
- * A result of {@link SpannerIO#write()} transform. Use {@link #getFailedMutations()} to access
- * failed Mutations. {@link #getOutput()} can be used as a completion signal with the {@link
- * org.apache.beam.sdk.transforms.Wait Wait} transform.
+ * The results of a {@link SpannerIO#write()} transform.
+ *
+ * <p>Use {@link #getFailedMutations()} to access a {@link PCollection} of MutationGroups that
+ * failed to write.
+ *
+ * <p>The {@link PCollection} returned by {@link #getOutput()} can be used in batch pipelines as a
+ * completion signal to {@link org.apache.beam.sdk.transforms.Wait Wait.OnSignal} to indicate when
+ * all input has been written. Note that in streaming pipelines, this signal will never be triggered
+ * as the input is unbounded and this {@link PCollection} is using the {@link
+ * org.apache.beam.sdk.transforms.windowing.GlobalWindow GlobalWindow}.
  */
 public class SpannerWriteResult implements POutput {
   private final Pipeline pipeline;