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

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

                Author: ASF GitHub Bot
            Created on: 08/Aug/18 13:48
            Start Date: 08/Aug/18 13:48
    Worklog Time Spent: 10m 
      Work Description: timrobertson100 commented on a change in pull request 
#6146: [BEAM-3026] Adding retrying behavior on ElasticSearchIO
URL: https://github.com/apache/beam/pull/6146#discussion_r208544133
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/io/common/retry/BaseRetryConfiguration.java
 ##########
 @@ -0,0 +1,52 @@
+/*
+ * 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.common.retry;
+
+import java.io.Serializable;
+import org.joda.time.Duration;
+
+/**
+ * A POJO encapsulating a configuration for retry behavior when issuing 
requests. A retry will be
+ * attempted until the maxAttempts or maxDuration is exceeded, whichever comes 
first.
+ */
+public class BaseRetryConfiguration implements Serializable {
+
+  private int maxAttempts;
+  private Duration maxDuration;
+  protected RetryPredicate retryPredicate;
 
 Review comment:
   ~~I'm afraid this refactor does not achieve the objective.  The refactor 
allows users to provide a configuration which contains the rules for when a 
retry is attempted.  The goal is to not expose that ability in keeping with the 
beam policy of not exposing configuration for things that shouldn't be 
necessary. ~~
   
   Apologies - I see that it does indeed enforce it because of the private 
constructors in the base class implementations

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 132377)
    Time Spent: 5h  (was: 4h 50m)

> Improve retrying in ElasticSearch client
> ----------------------------------------
>
>                 Key: BEAM-3026
>                 URL: https://issues.apache.org/jira/browse/BEAM-3026
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-elasticsearch
>            Reporter: Tim Robertson
>            Assignee: Ravi Pathak
>            Priority: Major
>             Fix For: 2.7.0
>
>          Time Spent: 5h
>  Remaining Estimate: 0h
>
> Currently an overloaded ES server will result in clients failing fast.
> I suggest implementing backoff pauses.  Perhaps something like this:
> {code}
>     ElasticsearchIO.ConnectionConfiguration conn = 
> ElasticsearchIO.ConnectionConfiguration
>       .create(new String[]{"http://...:9200"}, "test", "test")
>       .retryWithWaitStrategy(WaitStrategies.exponentialBackoff(1000, 
> TimeUnit.MILLISECONDS)
>       .retryWithStopStrategy(StopStrategies.stopAfterAttempt(10)
>     );
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to