public final class AWSClientConfig extends Object
See software.amazon.awssdk.http.SdkHttpConfigurationOption
for the default values.
Modifier and Type | Method and Description |
---|---|
static software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient.Builder |
createAsyncHttpClientBuilder(org.apache.hadoop.conf.Configuration conf)
Create and configure the async http client with timeouts for:
connection acquisition, max idle, timeout, TTL, socket and keepalive.
|
static software.amazon.awssdk.http.nio.netty.ProxyConfiguration |
createAsyncProxyConfiguration(org.apache.hadoop.conf.Configuration conf,
String bucket)
Configures the proxy for the async http client.
|
static software.amazon.awssdk.core.client.config.ClientOverrideConfiguration.Builder |
createClientConfigBuilder(org.apache.hadoop.conf.Configuration conf,
String awsServiceIdentifier)
Create the config for a given service...the service identifier is used
to determine signature implementation.
|
static software.amazon.awssdk.http.apache.ApacheHttpClient.Builder |
createHttpClientBuilder(org.apache.hadoop.conf.Configuration conf)
Create and configure the http client-based connector with timeouts for:
connection acquisition, max idle, timeout, TTL, socket and keepalive.
|
static software.amazon.awssdk.http.apache.ProxyConfiguration |
createProxyConfiguration(org.apache.hadoop.conf.Configuration conf,
String bucket)
Configures the proxy.
|
static software.amazon.awssdk.core.retry.RetryPolicy.Builder |
createRetryPolicyBuilder(org.apache.hadoop.conf.Configuration conf)
Configures the retry policy.
|
static Duration |
getMinimumOperationDuration()
Get the current minimum operation duration.
|
static void |
resetMinimumOperationDuration()
Reset the minimum operation duration to the default.
|
static void |
setMinimumOperationDuration(Duration duration)
Set the minimum operation duration.
|
static void |
setRequestTimeout(software.amazon.awssdk.awscore.AwsRequest.Builder builder,
Duration timeout)
Set a custom ApiCallTimeout for a single request.
|
public static software.amazon.awssdk.core.client.config.ClientOverrideConfiguration.Builder createClientConfigBuilder(org.apache.hadoop.conf.Configuration conf, String awsServiceIdentifier) throws IOException
conf
- configurationawsServiceIdentifier
- serviceIOException
- failure.RuntimeException
- some failures creating an http signerpublic static software.amazon.awssdk.http.apache.ApacheHttpClient.Builder createHttpClientBuilder(org.apache.hadoop.conf.Configuration conf) throws IOException
NetworkBinding.bindSSLChannelMode(Configuration, ApacheHttpClient.Builder)
.conf
- The Hadoop configurationIOException
- on any problempublic static software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient.Builder createAsyncHttpClientBuilder(org.apache.hadoop.conf.Configuration conf)
conf
- The Hadoop configurationpublic static software.amazon.awssdk.core.retry.RetryPolicy.Builder createRetryPolicyBuilder(org.apache.hadoop.conf.Configuration conf)
RetryMode.ADAPTIVE
, which
"dynamically limits the rate of AWS requests to maximize success rate",
possibly at the expense of latency.
Based on the ABFS experience, it is better to limit the rate requests are
made rather than have to resort to exponential backoff after failures come
in -especially as that backoff is per http connection.conf
- The Hadoop configurationpublic static software.amazon.awssdk.http.apache.ProxyConfiguration createProxyConfiguration(org.apache.hadoop.conf.Configuration conf, String bucket) throws IOException
conf
- The Hadoop configurationbucket
- Optional bucket to use to look up per-bucket proxy secretsIOException
- on any IO problempublic static software.amazon.awssdk.http.nio.netty.ProxyConfiguration createAsyncProxyConfiguration(org.apache.hadoop.conf.Configuration conf, String bucket) throws IOException
Although this is netty specific, it is part of the AWS SDK public API and not any shaded netty internal class.
conf
- The Hadoop configurationbucket
- Optional bucket to use to look up per-bucket proxy secretsIOException
- on any IO problem@VisibleForTesting public static void resetMinimumOperationDuration()
This MUST be called in test teardown in any test suite which
called setMinimumOperationDuration(Duration)
.
@VisibleForTesting public static void setMinimumOperationDuration(Duration duration)
Test suites must call resetMinimumOperationDuration()
in their teardown
to avoid breaking subsequent tests in the same process.
duration
- non-negative durationIllegalArgumentException
- if the duration is negative.public static Duration getMinimumOperationDuration()
public static void setRequestTimeout(software.amazon.awssdk.awscore.AwsRequest.Builder builder, Duration timeout)
If the timeout is zero, the request is not patched.
builder
- builder to patch.timeout
- timeoutCopyright © 2008–2024 Apache Software Foundation. All rights reserved.