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

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

                Author: ASF GitHub Bot
            Created on: 21/Aug/20 11:32
            Start Date: 21/Aug/20 11:32
    Worklog Time Spent: 10m 
      Work Description: dennisylyung commented on pull request #12658:
URL: https://github.com/apache/beam/pull/12658#issuecomment-678244868


   R: @iemejia


----------------------------------------------------------------
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: 473278)
    Time Spent: 20m  (was: 10m)

> DynamoDBIO.RetryConfiguration does not have public constructor
> --------------------------------------------------------------
>
>                 Key: BEAM-10673
>                 URL: https://issues.apache.org/jira/browse/BEAM-10673
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-aws
>    Affects Versions: 2.23.0
>            Reporter: Dennis Yung
>            Assignee: Dennis Yung
>            Priority: P2
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> As described in the documentation, DynamoDBIO is initiated with a 
> RetryConfiguration through withRetryConfiguration()
> {code:java}
>  PCollection<T> data = ...;
>  data.apply(
>            DynamoDBIO.<WriteRequest>write()
>                .withWriteRequestMapperFn(
>                    (SerializableFunction<T, KV<String, WriteRequest>>)
>                        //Transforming your T data into KV<String, 
> WriteRequest>
>                        t -> KV.of(tableName, writeRequest))
>                .withRetryConfiguration(
>                     DynamoDBIO.RetryConfiguration.create(5, 
> Duration.standardMinutes(1)))
>                .withAwsClientsProvider(new BasicDynamoDbProvider(accessKey, 
> secretKey, region));
> {code}
> It works on beam-sdks-java-io-amazon-web-services (aws sdk version 1), but 
> not on beam-sdks-java-io-amazon-web-services2 (aws sdk version 2).
> It is because io.aws2.dynamodb.DynamoDBIO.RetryConfiguration adopted a 
> AutoValue builder design in place of the create method. However, the builder 
> do not have public methods for setting values and building a 
> RetryConfiguration. Moreover, validation was not implemented
> {code:java}
>   @AutoValue
>   public abstract static class RetryConfiguration implements Serializable {
>     
>    /.../
>     public static Builder builder() {
>       return new AutoValue_DynamoDBIO_RetryConfiguration.Builder();
>     }
>     @AutoValue.Builder
>     abstract static class Builder {
>       abstract Builder setMaxAttempts(int maxAttempts);
>       abstract Builder setMaxDuration(Duration maxDuration);
>       abstract Builder setRetryPredicate(RetryPredicate retryPredicate);
>       abstract RetryConfiguration build();
>     }
> {code}



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

Reply via email to