You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/03/06 01:30:16 UTC

[GitHub] [beam] dpcollins-google commented on a change in pull request #13980: [BEAM-11659] Add new schema types to Pub/Sub SQL

dpcollins-google commented on a change in pull request #13980:
URL: https://github.com/apache/beam/pull/13980#discussion_r588809756



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubMessage.java
##########
@@ -31,51 +31,68 @@
   "nullness" // TODO(https://issues.apache.org/jira/browse/BEAM-10402)
 })
 public class PubsubMessage {
+  @AutoValue
+  abstract static class Impl {
+    @SuppressWarnings("mutable")
+    abstract byte[] getPayload();
 
-  private byte[] message;
-  private @Nullable Map<String, String> attributes;
-  private @Nullable String messageId;
+    abstract @Nullable Map<String, String> getAttributeMap();
+
+    abstract @Nullable String getMessageId();
+
+    static Impl create(
+        byte[] payload, @Nullable Map<String, String> attributes, @Nullable String messageId) {
+      return new AutoValue_PubsubMessage_Impl(payload, attributes, messageId);
+    }
+  }
+
+  private Impl impl;

Review comment:
       Yes, thats exactly what its for. This can't be changed to an AutoValue class without an API break as it has constructors, but we can implement these methods in an automated fashion.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org