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

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

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

 ##########
 File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreBatchRequest.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * 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 com.google.cloud.firestore.DocumentReference;
+import com.google.cloud.firestore.Firestore;
+import com.google.cloud.firestore.WriteBatch;
+
+import java.util.List;
+
+
+public class FirestoreBatchRequest<T> {
+    private Firestore firestoreClient;
+
+    public FirestoreBatchRequest(Firestore firestoreClient) {
+        this.firestoreClient = firestoreClient;
+    }
+
+    public WriteBatch batchWithKey(List<T> input, String collection, String 
key) {
+        WriteBatch batch = firestoreClient.batch();
 
 Review comment:
   Please note that `WriteBatch` is atomic transaction.
   Large `WriteBatch` could leads to contention and high error rates.
   
   We are working on launching a batchWrite API for non-atomic data ingestion 
use cases. Before it gets launched, the next best option is writing each 
document separately.
   
   (BTW, we have a max 500 write per commit limit.)
   
 
----------------------------------------------------------------
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: 354626)
    Time Spent: 1.5h  (was: 1h 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: 1.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