beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [46/50] [abbrv] beam git commit: Introduces read/writePubsubMessages
Date Thu, 04 May 2017 19:54:11 GMT
Introduces read/writePubsubMessages


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

Branch: refs/heads/gearpump-runner
Commit: eca553f2919b101b141016f28488d336d8af35ac
Parents: 429c613
Author: Eugene Kirpichov <kirpichov@google.com>
Authored: Thu Apr 20 23:06:41 2017 -0700
Committer: Eugene Kirpichov <kirpichov@google.com>
Committed: Tue May 2 23:08:29 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/eca553f2/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java
b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java
index 1c3de76..133839c 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java
@@ -529,10 +529,15 @@ public class PubsubIO {
   }
 
   /** Returns A {@link PTransform} that writes to a Google Cloud Pub/Sub stream. */
-  public static <T> Write<T> write() {
+  private static <T> Write<T> write() {
     return new AutoValue_PubsubIO_Write.Builder<T>().build();
   }
 
+  /** Returns A {@link PTransform} that writes to a Google Cloud Pub/Sub stream. */
+  public static Write<PubsubMessage> writePubsubMessages() {
+    return PubsubIO.<PubsubMessage>write().withFormatFn(new IdentityMessageFn());
+  }
+
   /**
    * Returns A {@link PTransform} that writes UTF-8 encoded strings to a Google Cloud Pub/Sub
    * stream.


Mime
View raw message