[ 
https://issues.apache.org/jira/browse/BEAM-11659?focusedWorklogId=539882&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-539882
 ]

ASF GitHub Bot logged work on BEAM-11659:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jan/21 06:30
            Start Date: 22/Jan/21 06:30
    Worklog Time Spent: 10m 
      Work Description: amaliujia commented on a change in pull request #13773:
URL: https://github.com/apache/beam/pull/13773#discussion_r561233154



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/io/GenericDlqProvider.java
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.schemas.io;
+
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Experimental.Kind;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PDone;
+
+/** A Provider for generic DLQ transforms that handle deserialization 
failures. */
+@Internal
+@Experimental(Kind.SCHEMAS)
+public interface GenericDlqProvider {
+  /** Returns an id that uniquely represents this Dlq Provider. */
+  String identifier();
+
+  /** Generate a DLQ output from the provided config value. */
+  PTransform<PCollection<Failure>, PDone> newDlqTransform(String config);

Review comment:
       Is there better to use Class as the parameter to look up the 
implementation, compared to those code to pass a key value pair string? 

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubDlqProvider.java
##########
@@ -0,0 +1,69 @@
+/*
+ * 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 static java.nio.charset.StandardCharsets.UTF_8;
+
+import com.google.auto.service.AutoService;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.schemas.io.Failure;
+import org.apache.beam.sdk.schemas.io.GenericDlqProvider;
+import org.apache.beam.sdk.transforms.MapElements;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PDone;
+import org.apache.beam.sdk.values.TypeDescriptor;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
+
+@Internal
+@AutoService(GenericDlqProvider.class)
+public class PubsubDlqProvider implements GenericDlqProvider {
+  @Override
+  public String identifier() {
+    return "pubsub";

Review comment:
       I see. I think this is ok.

##########
File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/schemas/io/GenericDlqTest.java
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.schemas.io;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertThrows;
+
+import org.apache.beam.sdk.testing.NeedsRunner;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.transforms.Create;
+import org.hamcrest.CoreMatchers;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class GenericDlqTest {
+  @Rule public final transient TestPipeline p = TestPipeline.create();
+
+  @Test
+  @Category(NeedsRunner.class)

Review comment:
       I see. I am not aware of the change but I haven't written any test case 
in a while.

##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/io/GenericDlqProvider.java
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.schemas.io;
+
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Experimental.Kind;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PDone;
+
+/** A Provider for generic DLQ transforms that handle deserialization 
failures. */
+@Internal
+@Experimental(Kind.SCHEMAS)
+public interface GenericDlqProvider {
+  /** Returns an id that uniquely represents this Dlq Provider. */
+  String identifier();
+
+  /** Generate a DLQ output from the provided config value. */
+  PTransform<PCollection<Failure>, PDone> newDlqTransform(String config);

Review comment:
       SG




----------------------------------------------------------------
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: 539882)
    Time Spent: 4h 40m  (was: 4.5h)

> Integrate Pub/Sub Lite with beam SQL
> ------------------------------------
>
>                 Key: BEAM-11659
>                 URL: https://issues.apache.org/jira/browse/BEAM-11659
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql, io-java-gcp
>            Reporter: Daniel Collins
>            Assignee: Daniel Collins
>            Priority: P2
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> Pub/Sub Lite should be a valid source and sink for beam SQL.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to