public final class NetworkBinding extends Object
Modifier and Type | Method and Description |
---|---|
static void |
bindSSLChannelMode(org.apache.hadoop.conf.Configuration conf,
software.amazon.awssdk.http.apache.ApacheHttpClient.Builder httpClientBuilder)
Configures the
SSLConnectionSocketFactory used by the AWS SDK. |
static String |
fixBucketRegion(String region)
Given an S3 bucket region as returned by a bucket location query,
fix it into a form which can be used by other AWS commands.
|
static boolean |
isAwsEndpoint(String endpoint)
Is this an AWS endpoint? looks at end of FQDN.
|
static void |
logDnsLookup(org.apache.hadoop.conf.Configuration conf)
Log the dns address associated with s3 endpoint.
|
public static void bindSSLChannelMode(org.apache.hadoop.conf.Configuration conf, software.amazon.awssdk.http.apache.ApacheHttpClient.Builder httpClientBuilder) throws IOException
SSLConnectionSocketFactory
used by the AWS SDK.
A custom Socket Factory can be set using the method
setSslSocketFactory()
.
Uses reflection to do this via ConfigureShadedAWSSocketFactory
so as to avoidconf
- the Configuration
used to get the client specified
value of SSL_CHANNEL_MODE
httpClientBuilder
- the http client builder.IOException
- if there is an error while initializing the
SSLSocketFactory
other than classloader problems.public static boolean isAwsEndpoint(String endpoint)
endpoint
- endpointpublic static String fixBucketRegion(String region)
https://forums.aws.amazon.com/thread.jspa?messageID=796829
See alsocom.amazonaws.services.s3.model.Region.fromValue()
for its conversion logic.region
- region from S3 call.public static void logDnsLookup(org.apache.hadoop.conf.Configuration conf)
Constants#DEFAULT_ENDPOINT
will be used.conf
- input configuration.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.