public static final class DefaultS3CrtAsyncClient.DefaultS3CrtClientBuilder extends Object implements S3CrtAsyncClientBuilder
| Constructor and Description |
|---|
DefaultS3CrtClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
S3CrtAsyncClientBuilder |
accelerate(Boolean accelerate)
Enables this client to use S3 Transfer Acceleration endpoints.
|
S3CrtAsyncClient |
build() |
S3CrtAsyncClientBuilder |
checksumValidationEnabled(Boolean checksumValidationEnabled)
Option to disable checksum validation for
S3AsyncClient.getObject(GetObjectRequest, Path) and
S3AsyncClient.putObject(PutObjectRequest, Path). |
AwsCredentialsProvider |
credentialsProvider() |
S3CrtAsyncClientBuilder |
credentialsProvider(AwsCredentialsProvider credentialsProvider)
Configure the credentials that should be used to authenticate with S3.
|
boolean |
crossRegionAccessEnabled() |
S3CrtAsyncClientBuilder |
crossRegionAccessEnabled(Boolean crossRegionAccessEnabled)
Configures whether cross-region bucket access is enabled for clients using the configuration.
|
URI |
endpointOverride() |
S3CrtAsyncClientBuilder |
endpointOverride(URI endpointOverride)
Configure the endpoint override with which the SDK should communicate.
|
S3CrtAsyncClientBuilder |
forcePathStyle(Boolean forcePathStyle)
Forces this client to use path-style addressing for buckets.
|
S3CrtAsyncClientBuilder |
httpConfiguration(S3CrtHttpConfiguration configuration)
Sets the HTTP configuration to use for this client.
|
S3CrtAsyncClientBuilder |
initialReadBufferSizeInBytes(Long readBufferSizeInBytes)
Configure the starting buffer size the client will use to buffer the parts downloaded from S3.
|
Integer |
maxConcurrency() |
S3CrtAsyncClientBuilder |
maxConcurrency(Integer maxConcurrency)
Specifies the maximum number of S3 connections that should be established during
a transfer.
|
Long |
minimumPartSizeInBytes() |
S3CrtAsyncClientBuilder |
minimumPartSizeInBytes(Long partSizeBytes)
Sets the minimum part size for transfer parts.
|
Long |
readBufferSizeInBytes() |
Region |
region() |
S3CrtAsyncClientBuilder |
region(Region region)
Configure the region with which the SDK should communicate.
|
S3CrtAsyncClientBuilder |
retryConfiguration(S3CrtRetryConfiguration retryConfiguration)
Sets the Retry configuration to use for this client.
|
Double |
targetThroughputInGbps() |
S3CrtAsyncClientBuilder |
targetThroughputInGbps(Double targetThroughputInGbps)
The target throughput for transfer requests.
|
S3CrtAsyncClientBuilder |
thresholdInBytes(Long thresholdInBytes)
Configure the size threshold, in bytes, for when to use multipart upload.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithttpConfiguration, retryConfigurationapplyMutationpublic AwsCredentialsProvider credentialsProvider()
public Region region()
public Long minimumPartSizeInBytes()
public Double targetThroughputInGbps()
public Integer maxConcurrency()
public URI endpointOverride()
public Long readBufferSizeInBytes()
public boolean crossRegionAccessEnabled()
public S3CrtAsyncClientBuilder credentialsProvider(AwsCredentialsProvider credentialsProvider)
S3CrtAsyncClientBuilderThe default provider will attempt to identify the credentials automatically using the following checks:
aws.accessKeyId and aws.secretKeyAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEYIf the credentials are not found in any of the locations above, an exception will be thrown at S3CrtAsyncClientBuilder.build()
time.
credentialsProvider in interface S3CrtAsyncClientBuildercredentialsProvider - the credentials to usepublic S3CrtAsyncClientBuilder region(Region region)
S3CrtAsyncClientBuilderIf this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
region in interface S3CrtAsyncClientBuilderregion - the region to be usedpublic S3CrtAsyncClientBuilder minimumPartSizeInBytes(Long partSizeBytes)
S3CrtAsyncClientBuilderBy default, it is 8MB. See Amazon S3 multipart upload limits for guidance.
minimumPartSizeInBytes in interface S3CrtAsyncClientBuilderpartSizeBytes - The minimum part size for transfer parts.public S3CrtAsyncClientBuilder targetThroughputInGbps(Double targetThroughputInGbps)
S3CrtAsyncClientBuilder
Whether the transfer manager can achieve the configured target throughput depends on various factors such as the network
bandwidth of the environment and whether S3CrtAsyncClientBuilder.maxConcurrency(java.lang.Integer) is configured.
By default, it is 10 gigabits per second. If users want to transfer as fast as possible, it's recommended to set it to the
maximum network bandwidth on the host that the application is running on. For EC2 instances, you can find network
bandwidth for a specific
instance type in Amazon EC2 instance type page.
If you are running into out of file descriptors error, consider using S3CrtAsyncClientBuilder.maxConcurrency(Integer) to limit the
number of connections.
targetThroughputInGbps in interface S3CrtAsyncClientBuildertargetThroughputInGbps - the target throughput in GbpsS3CrtAsyncClientBuilder.maxConcurrency(Integer)public S3CrtAsyncClientBuilder maxConcurrency(Integer maxConcurrency)
S3CrtAsyncClientBuilder
If not provided, the TransferManager will calculate the optional number of connections
based on S3CrtAsyncClientBuilder.targetThroughputInGbps(java.lang.Double). If the value is too low, the S3TransferManager
might not achieve the specified target throughput.
maxConcurrency in interface S3CrtAsyncClientBuildermaxConcurrency - the max number of concurrent requestsS3CrtAsyncClientBuilder.targetThroughputInGbps(Double)public S3CrtAsyncClientBuilder endpointOverride(URI endpointOverride)
S3CrtAsyncClientBuilderendpointOverride in interface S3CrtAsyncClientBuilderendpointOverride - the endpoint override to be usedpublic S3CrtAsyncClientBuilder checksumValidationEnabled(Boolean checksumValidationEnabled)
S3CrtAsyncClientBuilderS3AsyncClient.getObject(GetObjectRequest, Path) and
S3AsyncClient.putObject(PutObjectRequest, Path).
Checksum validation using CRC32 is enabled by default.
checksumValidationEnabled in interface S3CrtAsyncClientBuilderpublic S3CrtAsyncClientBuilder initialReadBufferSizeInBytes(Long readBufferSizeInBytes)
S3CrtAsyncClientBuilderBy default, it is equal to the resolved part size * 10
initialReadBufferSizeInBytes in interface S3CrtAsyncClientBuilderreadBufferSizeInBytes - the initial read buffer sizepublic S3CrtAsyncClientBuilder httpConfiguration(S3CrtHttpConfiguration configuration)
S3CrtAsyncClientBuilderhttpConfiguration in interface S3CrtAsyncClientBuilderconfiguration - The http proxy configuration to usepublic S3CrtAsyncClientBuilder accelerate(Boolean accelerate)
S3CrtAsyncClientBuilderaccelerate in interface S3CrtAsyncClientBuilderpublic S3CrtAsyncClientBuilder forcePathStyle(Boolean forcePathStyle)
S3CrtAsyncClientBuilderforcePathStyle in interface S3CrtAsyncClientBuilderpublic S3CrtAsyncClientBuilder retryConfiguration(S3CrtRetryConfiguration retryConfiguration)
S3CrtAsyncClientBuilderretryConfiguration in interface S3CrtAsyncClientBuilderretryConfiguration - The retry configurations to be used.public S3CrtAsyncClientBuilder crossRegionAccessEnabled(Boolean crossRegionAccessEnabled)
S3CrtAsyncClientBuilderConfigures whether cross-region bucket access is enabled for clients using the configuration.
The following behavior is used when this mode is enabled:
Enabling this mode has several drawbacks, as it can increase latency if the bucket's location is physically far from the location of the request.Therefore, it is strongly advised, whenever possible, to know the location of your buckets and create a region-specific client to access them
crossRegionAccessEnabled in interface S3CrtAsyncClientBuildercrossRegionAccessEnabled - Whether cross region bucket access should be enabled.public S3CrtAsyncClientBuilder thresholdInBytes(Long thresholdInBytes)
S3CrtAsyncClientBuilderMultipart uploads are easier to recover from and also potentially faster than single part uploads, especially when the upload parts can be uploaded in parallel. Because there are additional network API calls, small objects are still recommended to use a single connection for the upload. See Uploading and copying objects using multipart upload.
By default, it is the same as S3CrtAsyncClientBuilder.minimumPartSizeInBytes(Long).
thresholdInBytes in interface S3CrtAsyncClientBuilderthresholdInBytes - the value of the threshold to set.public S3CrtAsyncClient build()
build in interface S3CrtAsyncClientBuilderbuild in interface Buildablebuild in interface SdkBuilder<S3CrtAsyncClientBuilder,S3AsyncClient>Copyright © 2023. All rights reserved.