[
https://issues.apache.org/jira/browse/BEAM-8932?focusedWorklogId=369013&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-369013
]
ASF GitHub Bot logged work on BEAM-8932:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Jan/20 13:22
Start Date: 09/Jan/20 13:22
Worklog Time Spent: 10m
Work Description: mxm commented on pull request #10476:
[BEAM-8932][Cleanup] Move external PubsubIO hooks outside of PubsubIO.
URL: https://github.com/apache/beam/pull/10476#discussion_r364732607
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/ExternalWrite.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.io.gcp.pubsub;
+
+import com.google.auto.service.AutoService;
+import com.google.common.collect.ImmutableMap;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.util.Map;
+import jdk.internal.jline.internal.Nullable;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.expansion.ExternalTransformRegistrar;
+import org.apache.beam.sdk.io.gcp.pubsub.PubsubIO.PubsubTopic;
+import org.apache.beam.sdk.options.ValueProvider.NestedValueProvider;
+import org.apache.beam.sdk.options.ValueProvider.StaticValueProvider;
+import org.apache.beam.sdk.transforms.ExternalTransformBuilder;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.SimpleFunction;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PDone;
+
+/** Exposes {@link PubsubIO.Write} as an external transform for cross-language
usage. */
+@Experimental
+@AutoService(ExternalTransformRegistrar.class)
+public final class ExternalWrite implements ExternalTransformRegistrar {
+ public ExternalWrite() {}
+
+ public static final String URN = "beam:external:java:pubsub:write:v1";
+
+ @Override
+ public Map<String, Class<? extends ExternalTransformBuilder>>
knownBuilders() {
+ return ImmutableMap.of(URN, WriteBuilder.class);
+ }
+
+ /** Parameters class to expose the transform to an external SDK. */
+ public static class Configuration {
+
+ // All byte arrays are UTF-8 encoded strings
+ private String topic;
Review comment:
This comment is outdated. Plead update.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 369013)
Time Spent: 9h 50m (was: 9h 40m)
> Expose complete Cloud Pub/Sub messages through PubsubIO API
> -----------------------------------------------------------
>
> Key: BEAM-8932
> URL: https://issues.apache.org/jira/browse/BEAM-8932
> Project: Beam
> Issue Type: Bug
> Components: beam-model
> Reporter: Daniel Collins
> Assignee: Daniel Collins
> Priority: Major
> Time Spent: 9h 50m
> Remaining Estimate: 0h
>
> The PubsubIO API only exposes a subset of the fields in the underlying
> PubsubMessage protocol buffer. To accomodate future feature changes as well
> as for greater compatability with code using the Cloud Pub/Sub apis, a method
> to read and write these protocol messages should be exposed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)