[
https://issues.apache.org/jira/browse/BEAM-8376?focusedWorklogId=352135&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-352135
]
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_r352770461
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/WriteBatcherImpl.java
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting;
+
+import java.io.Serializable;
+
+/**
+ * Determines batch sizes for commit RPCs based on past performance.
+ *
+ * <p>It aims for a target response time per RPC: it uses the response times
for previous RPCs and
+ * the number of entities contained in them, calculates a rolling average
time-per-entity, and
+ * chooses the number of entities for future writes to hit the target time.
+ *
+ * <p>This enables us to send large batches without sending over-large
requests in the case of
+ * expensive entity writes that may timeout before the server can apply them
all.
+ */
+@VisibleForTesting
+public class WriteBatcherImpl implements WriteBatcher, Serializable {
+ /** Target time per RPC for writes. */
+ static final int FIRESTORE_BATCH_TARGET_LATENCY_MS = 5000;
Review comment:
Please document these constants.
----------------------------------------------------------------
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: 352135)
Time Spent: 50m (was: 40m)
> 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: 50m
> 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)