Package org.apache.hadoop.fs.s3a
Class DefaultS3ClientFactory
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.s3a.DefaultS3ClientFactory
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,S3ClientFactory
- Direct Known Subclasses:
EncryptionS3ClientFactory
@Private
@Unstable
public class DefaultS3ClientFactory
extends org.apache.hadoop.conf.Configured
implements S3ClientFactory
The default
S3ClientFactory implementation.
This calls the AWS SDK to configure and create an
AmazonS3Client that communicates with the S3 service.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.fs.s3a.S3ClientFactory
S3ClientFactory.S3ClientCreationParameters -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError message when an endpoint is set with FIPS enabled: "Non central endpoint cannot be set when fs.s3a.endpoint.fips is true".protected static final org.slf4j.LoggerSubclasses refer to this. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected software.amazon.awssdk.core.client.config.ClientOverrideConfiguration.BuildercreateClientOverrideConfiguration(S3ClientFactory.S3ClientCreationParameters parameters, org.apache.hadoop.conf.Configuration conf) Create an override configuration for an S3 client.software.amazon.awssdk.services.s3.S3AsyncClientcreateS3AsyncClient(URI uri, S3ClientFactory.S3ClientCreationParameters parameters) Creates a newS3AsyncClient.software.amazon.awssdk.services.s3.S3ClientcreateS3Client(URI uri, S3ClientFactory.S3ClientCreationParameters parameters) Creates a newS3Client.software.amazon.awssdk.transfer.s3.S3TransferManagercreateS3TransferManager(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient) Creates a newS3TransferManager.protected static URIgetS3Endpoint(String endpoint, org.apache.hadoop.conf.Configuration conf) Given a endpoint string, create the endpoint URI.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGSubclasses refer to this. -
ERROR_ENDPOINT_WITH_FIPS
Error message when an endpoint is set with FIPS enabled: "Non central endpoint cannot be set when fs.s3a.endpoint.fips is true".- See Also:
-
-
Constructor Details
-
DefaultS3ClientFactory
public DefaultS3ClientFactory()
-
-
Method Details
-
createS3Client
public software.amazon.awssdk.services.s3.S3Client createS3Client(URI uri, S3ClientFactory.S3ClientCreationParameters parameters) throws IOException Description copied from interface:S3ClientFactoryCreates a newS3Client. The client returned supports synchronous operations. For asynchronous operations, useS3ClientFactory.createS3AsyncClient(URI, S3ClientCreationParameters).- Specified by:
createS3Clientin interfaceS3ClientFactory- Parameters:
uri- S3A file system URIparameters- parameter object- Returns:
- S3 client
- Throws:
IOException- on any IO problem
-
createS3AsyncClient
public software.amazon.awssdk.services.s3.S3AsyncClient createS3AsyncClient(URI uri, S3ClientFactory.S3ClientCreationParameters parameters) throws IOException Description copied from interface:S3ClientFactoryCreates a newS3AsyncClient. The client returned supports asynchronous operations. For synchronous operations, useS3ClientFactory.createS3Client(URI, S3ClientCreationParameters).- Specified by:
createS3AsyncClientin interfaceS3ClientFactory- Parameters:
uri- S3A file system URIparameters- parameter object- Returns:
- Async S3 client
- Throws:
IOException- on any IO problem
-
createS3TransferManager
public software.amazon.awssdk.transfer.s3.S3TransferManager createS3TransferManager(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient) Description copied from interface:S3ClientFactoryCreates a newS3TransferManager.- Specified by:
createS3TransferManagerin interfaceS3ClientFactory- Parameters:
s3AsyncClient- the async client to be used by the TM.- Returns:
- S3 transfer manager
-
createClientOverrideConfiguration
protected software.amazon.awssdk.core.client.config.ClientOverrideConfiguration.Builder createClientOverrideConfiguration(S3ClientFactory.S3ClientCreationParameters parameters, org.apache.hadoop.conf.Configuration conf) throws IOException Create an override configuration for an S3 client.- Parameters:
parameters- parameter objectconf- configuration object- Returns:
- the override configuration
- Throws:
IOException- any IOE raised, or translated exceptionRuntimeException- some failures creating an http signerIOException- any IOE raised, or translated exception
-
getS3Endpoint
Given a endpoint string, create the endpoint URI.- Parameters:
endpoint- possibly null endpoint.conf- config to build the URI from.- Returns:
- an endpoint uri
-