[
https://issues.apache.org/jira/browse/BEAM-10139?focusedWorklogId=510757&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-510757
]
ASF GitHub Bot logged work on BEAM-10139:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Nov/20 11:59
Start Date: 12/Nov/20 11:59
Worklog Time Spent: 10m
Work Description: piotr-szuberski commented on a change in pull request
#12611:
URL: https://github.com/apache/beam/pull/12611#discussion_r522052915
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerTransformRegistrar.java
##########
@@ -0,0 +1,287 @@
+/*
+ * 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.spanner;
+
+import static
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.google.auto.service.AutoService;
+import com.google.cloud.Timestamp;
+import com.google.cloud.spanner.TimestampBound;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import org.apache.beam.model.pipeline.v1.SchemaApi;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Experimental.Kind;
+import org.apache.beam.sdk.expansion.ExternalTransformRegistrar;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.SchemaTranslation;
+import org.apache.beam.sdk.transforms.ExternalTransformBuilder;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PDone;
+import org.apache.beam.sdk.values.Row;
+import
org.apache.beam.vendor.grpc.v1p26p0.com.google.protobuf.InvalidProtocolBufferException;
+import
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
+import org.checkerframework.checker.nullness.qual.Nullable;
+import org.joda.time.Duration;
+
+/**
+ * Exposes {@link SpannerIO.WriteRows} and {@link SpannerIO.ReadRows} as an
external transform for
+ * cross-language usage.
+ */
+@Experimental(Kind.PORTABILITY)
+@AutoService(ExternalTransformRegistrar.class)
+public class SpannerTransformRegistrar implements ExternalTransformRegistrar {
+ public static final String WRITE_URN = "beam:external:java:spanner:write:v1";
+ public static final String READ_URN = "beam:external:java:spanner:read:v1";
+
+ @Override
+ public Map<String, ExternalTransformBuilder<?, ?, ?>>
knownBuilderInstances() {
+ return ImmutableMap.of(WRITE_URN, new WriteBuilder(), READ_URN, new
ReadBuilder());
Review comment:
That makes sense. Done.
----------------------------------------------------------------
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: 510757)
Time Spent: 29h 40m (was: 29.5h)
> Add cross-language wrapper for Java's SpannerIO Write
> -----------------------------------------------------
>
> Key: BEAM-10139
> URL: https://issues.apache.org/jira/browse/BEAM-10139
> Project: Beam
> Issue Type: Sub-task
> Components: cross-language, io-java-gcp, io-py-gcp
> Affects Versions: Not applicable
> Reporter: Piotr Szuberski
> Assignee: Piotr Szuberski
> Priority: P2
> Labels: portability
> Fix For: Not applicable
>
> Time Spent: 29h 40m
> Remaining Estimate: 0h
>
> Add cross-language wrapper for Java's SpannerIO Write
--
This message was sent by Atlassian Jira
(v8.3.4#803005)