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

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

                Author: ASF GitHub Bot
            Created on: 16/Feb/22 14:51
            Start Date: 16/Feb/22 14:51
    Worklog Time Spent: 10m 
      Work Description: mosche commented on a change in pull request #16760:
URL: https://github.com/apache/beam/pull/16760#discussion_r808048667



##########
File path: 
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/options/AwsOptions.java
##########
@@ -95,50 +137,43 @@ public AwsCredentialsProvider create(PipelineOptions 
options) {
   }
 
   /**
-   * The client configuration instance that should be used to configure AWS 
service clients. Please
-   * note that the configuration deserialization only allows one to specify 
proxy settings.
+   * {@link ProxyConfiguration} used to configure AWS service clients.
+   *
+   * <p>Note, only the options shown in the example below are supported. 
<code>username</code> and
+   * <code>password</code> are optional.
+   *
+   * <p>Example:
    *
-   * <p>For example, to specify the proxy endpoint, username and password, 
specify the following:
-   * <code>
-   * --proxyConfiguration={
+   * <pre>{@code --proxyConfiguration={
    *   "endpoint": "http://hostname:port";,
    *   "username": "username",
    *   "password": "password"
-   * }
-   * </code>
+   * }}</pre>
    */
   @Description(
-      "The proxy configuration instance that should be used to configure AWS 
service "
-          + "clients. Please note that the configuration deserialization only 
allows one to specify "
-          + "proxy settings. For example, to specify the proxy endpoint, 
username and password, "
-          + "specify the following: 
--proxyConfiguration={\"endpoint\":\"http://hostname:port\";, 
\"username\":\"username\", \"password\":\"password\"}")
+      "The proxy configuration used to configure AWS service clients. Example: 
"
+          + "--proxyConfiguration={\"endpoint\":\"http://hostname:port\";, 
\"username\":\"username\", \"password\":\"password\"}")
   ProxyConfiguration getProxyConfiguration();
 
   void setProxyConfiguration(ProxyConfiguration value);
 
   /**
-   * The client configuration instance that should be used to configure AWS 
service clients. Please
-   * note that the configuration deserialization allows aws http client 
configuration settings.
+   * {@link HttpClientConfiguration} used to configure AWS service clients.
    *
-   * <p>For example, to set different timeout for aws client service : Note 
that all the below
-   * fields are optional, so only add those configurations that need to be 
set. <code>
-   * --attributeMap={
-   *   "connectionAcquisitionTimeout":"PT1000S",
-   *   "connectionMaxIdleTime":"PT3000S",
-   *   "connectionTimeout":"PT10000S",
-   *   "socketTimeout":"PT600S",
-   *   "maxConnections":"10",
-   *   "socketTimeout":"PT5000SS"
-   * }
-   * </code>
+   * <p>Example:
    *
-   * @return
+   * <pre>{@code --httpClientConfiguration={"socketTimeout":1000, 
"maxConnections":10}}</pre>
    */
   @Description(
-      "The attribute map instance that should be used to configure AWS http 
client configuration parameters."
-          + "Mentioned parameters are the available parameters that can be 
set. All above parameters are "
-          + "optional set only those that need custom changes.")
-  AttributeMap getAttributeMap();
+      "The HTTP client configuration used to configure AWS service clients. 
Example: "
+          + 
"--httpClientConfiguration={\"socketTimeout\":1000,\"maxConnections\":10}")
+  HttpClientConfiguration getHttpClientConfiguration();
+
+  void setHttpClientConfiguration(HttpClientConfiguration value);
+
+  @Description("Factory class to configure AWS client builders")
+  @Default.Class(ClientBuilderFactory.DefaultClientBuilder.class)
+  Class<? extends ClientBuilderFactory> getClientBuilderFactory();
 
-  void setAttributeMap(AttributeMap attributeMap);

Review comment:
       Replaced by `HttpClientConfiguration`, but wasn't used at all previously 
...




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 728251)
    Time Spent: 8h  (was: 7h 50m)

> Generalize AWS client provider to be independent of client type
> ---------------------------------------------------------------
>
>                 Key: BEAM-13563
>                 URL: https://issues.apache.org/jira/browse/BEAM-13563
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-aws
>            Reporter: Moritz Mack
>            Assignee: Moritz Mack
>            Priority: P3
>              Labels: aws-sdk-v2
>          Time Spent: 8h
>  Remaining Estimate: 0h
>
> Currently each AWS IO uses its own client provider, in some cases also 
> separate ones for sync and async clients.
> Besides adding lots of boilerplate code across these IOs, this makes it 
> impossible to switch to an async implementation without breaking APIs. 
> The approach below would require only one common client provider to build all 
> kinds of clients:
> {code:java}
> public <BuilderT extends AwsClientBuilder<BuilderT, ClientT>, ClientT> 
> ClientT buildClient(BuilderT builder) {
>   if (endpoint != null) {
>     builder.endpointOverride(URI.create(endpoint));
>   }
>   return builder
>       .credentialsProvider(credentialsProvider)
>       .region(Region.of(region))
>       .build();
> }
> buildClient(DynamoDbClient.builder());
> buildClient(DynamoDbAsyncClient.builder());
> buildClient(S3Client.builder());
> buildClient(S3AsyncClient.builder());
> ...{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to