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

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

                Author: ASF GitHub Bot
            Created on: 02/Dec/19 19:40
            Start Date: 02/Dec/19 19:40
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on pull request #10187: 
[BEAM-8376] Initial version of firestore connector JavaSDK
URL: https://github.com/apache/beam/pull/10187#discussion_r352756237
 
 

 ##########
 File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreIO.java
 ##########
 @@ -0,0 +1,74 @@
+/*
+ * 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.firestore;
+
+import org.apache.beam.sdk.options.ValueProvider;
+
+import javax.annotation.Nullable;
+
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+public class FirestoreIO {
+
+    public Write write() {
+        return new Write(null, null, null);
+    }
+
+    public static class Write extends Mutate {
+        Write(@Nullable ValueProvider<String> projectId, String collectionId, 
@Nullable String keyId) {
+            super(projectId, collectionId, keyId);
+        }
+
+        /**
+         * Returns a new {@link Write} that writes to the Cloud Firestore for 
the specified project.
+         */
+        public Write withProjectId(String projectId) {
+            checkArgument(projectId != null, "projectId can not be null");
+            return 
withProjectId(ValueProvider.StaticValueProvider.of(projectId));
+        }
+
+        /**
+         * Same as {@link Write#withProjectId(String)} but with a {@link 
ValueProvider}.
+         */
+        public Write withProjectId(ValueProvider<String> projectId) {
+            checkArgument(projectId != null, "projectId can not be null");
+            return new Write(projectId, collectionId, keyId);
+        }
+
+        /**
+         * Returns a new {@link Write} that writes to the Cloud Firestore for 
the specified collection.
 
 Review comment:
   Probably it'll be good a brief description on collection IDs and/or point to 
some link on Firestore Website.
 
----------------------------------------------------------------
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: 352131)
    Time Spent: 0.5h  (was: 20m)

> Add FirestoreIO connector to Java SDK
> -------------------------------------
>
>                 Key: BEAM-8376
>                 URL: https://issues.apache.org/jira/browse/BEAM-8376
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-java-gcp
>            Reporter: Stefan Djelekar
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Motivation:
> There is no Firestore connector for Java SDK at the moment.
> Having it will enhance the integrations with database options on the Google 
> Cloud Platform.



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

Reply via email to