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

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

                Author: ASF GitHub Bot
            Created on: 06/May/21 23:10
            Start Date: 06/May/21 23:10
    Worklog Time Spent: 10m 
      Work Description: BenWhitehead commented on a change in pull request 
#14261:
URL: https://github.com/apache/beam/pull/14261#discussion_r627821682



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/RpcQosImpl.java
##########
@@ -83,48 +81,60 @@
   private final WriteRampUp writeRampUp;
   private final FluentBackoff fb;
 
-  private final WeakHashMap<Context, Counters> counters;
+  private final WeakHashMap<Context, O11y> counters;
   private final Random random;
   private final Sleeper sleeper;
-  private final Function<Context, Counters> computeCounters;
+  private final Function<Context, O11y> computeCounters;
+  private final DistributionFactory distributionFactory;
 
   RpcQosImpl(
       RpcQosOptions options,
       Random random,
       Sleeper sleeper,
-      CounterFactory counterFactory
-  ) {
+      CounterFactory counterFactory,
+      DistributionFactory distributionFactory) {
     this.options = options;
     this.random = random;
     this.sleeper = sleeper;
-    at = new AdaptiveThrottler();
-    wb = new WriteBatcher();
-    writeRampUp = new WriteRampUp(
-        Math.max(1, 500 / options.getHintMaxNumWorkers())
-    );
-    fb = FluentBackoff.DEFAULT
-        .withMaxRetries(options.getMaxAttempts() - 1) // maxRetries is an 
inclusive value, we want exclusive since we are tracking all attempts
-        .withInitialBackoff(options.getInitialBackoff());
+    DistributionFactory filteringDistributionFactory =
+        new DiagnosticOnlyFilteringDistributionFactory(
+            !options.isShouldReportDiagnosticMetrics(), distributionFactory);
+    this.distributionFactory = filteringDistributionFactory;
+    at =
+        new AdaptiveThrottler(
+            options.getSamplePeriod(),
+            options.getSamplePeriodBucketSize(),
+            options.getThrottleDuration(),
+            options.getOverloadRatio());
+    wb =
+        new WriteBatcher(
+            options.getSamplePeriod(),
+            options.getSamplePeriodBucketSize(),
+            options.getBatchInitialCount(),
+            options.getBatchTargetLatency(),
+            filteringDistributionFactory);
+    writeRampUp =
+        new WriteRampUp(
+            Math.max(1, 500 / options.getHintMaxNumWorkers()), 
filteringDistributionFactory);

Review comment:
       I'll push a commit with this change




-- 
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: 593058)
    Time Spent: 24h 10m  (was: 24h)

> 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: P3
>          Time Spent: 24h 10m
>  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