Class NetworkBinding

java.lang.Object
org.apache.hadoop.fs.s3a.impl.NetworkBinding

public final class NetworkBinding extends Object
Configures network settings when communicating with AWS services.
  • Method Summary

    Modifier and Type
    Method
    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
    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
    Is this an AWS endpoint?
    static void
    logDnsLookup(org.apache.hadoop.conf.Configuration conf)
    Log the dns address associated with s3 endpoint.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • bindSSLChannelMode

      public static void bindSSLChannelMode(org.apache.hadoop.conf.Configuration conf, software.amazon.awssdk.http.apache.ApacheHttpClient.Builder httpClientBuilder) throws IOException
      Configures the 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 avoid
      Parameters:
      conf - the Configuration used to get the client specified value of SSL_CHANNEL_MODE
      httpClientBuilder - the http client builder.
      Throws:
      IOException - if there is an error while initializing the SSLSocketFactory other than classloader problems.
    • isAwsEndpoint

      public static boolean isAwsEndpoint(String endpoint)
      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

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

      https://forums.aws.amazon.com/thread.jspa?messageID=796829

      See also com.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, the Constants#DEFAULT_ENDPOINT will be used.
      Parameters:
      conf - input configuration.