Package org.apache.hadoop.fs.s3a.impl
Class NetworkBinding
java.lang.Object
org.apache.hadoop.fs.s3a.impl.NetworkBinding
Configures network settings when communicating with AWS services.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindSSLChannelMode(org.apache.hadoop.conf.Configuration conf, software.amazon.awssdk.http.apache.ApacheHttpClient.Builder httpClientBuilder) Configures theSSLConnectionSocketFactoryused by the AWS SDK.static StringfixBucketRegion(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 booleanisAwsEndpoint(String endpoint) Is this an AWS endpoint?static voidlogDnsLookup(org.apache.hadoop.conf.Configuration conf) Log the dns address associated with s3 endpoint.
-
Method Details
-
bindSSLChannelMode
public static void bindSSLChannelMode(org.apache.hadoop.conf.Configuration conf, software.amazon.awssdk.http.apache.ApacheHttpClient.Builder httpClientBuilder) throws IOException Configures theSSLConnectionSocketFactoryused by the AWS SDK. A custom Socket Factory can be set using the methodsetSslSocketFactory(). Uses reflection to do this viaConfigureShadedAWSSocketFactoryso as to avoid- Parameters:
conf- theConfigurationused to get the client specified value ofSSL_CHANNEL_MODEhttpClientBuilder- the http client builder.- Throws:
IOException- if there is an error while initializing theSSLSocketFactoryother than classloader problems.
-
isAwsEndpoint
Is this an AWS endpoint? looks at end of FQDN.- Parameters:
endpoint- endpoint- Returns:
- true if the endpoint matches the requirements for an aws endpoint.
-
fixBucketRegion
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.https://forums.aws.amazon.com/thread.jspa?messageID=796829
See alsocom.amazonaws.services.s3.model.Region.fromValue()for its conversion logic.- Parameters:
region- region from S3 call.- Returns:
- the region to use in AWS services.
-
logDnsLookup
public static void logDnsLookup(org.apache.hadoop.conf.Configuration conf) Log the dns address associated with s3 endpoint. If endpoint is not set in the configuration, theConstants#DEFAULT_ENDPOINTwill be used.- Parameters:
conf- input configuration.
-