Class DefaultS3CrtAsyncClient.DefaultS3CrtClientBuilder

    • Constructor Detail

      • DefaultS3CrtClientBuilder

        public DefaultS3CrtClientBuilder()
    • Method Detail

      • credentialsProvider

        public S3CrtAsyncClientBuilder credentialsProvider​(IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider)
        Description copied from interface: S3CrtAsyncClientBuilder
        Configure the credentials that should be used to authenticate with S3.

        The default provider will attempt to identify the credentials automatically using the following checks:

        1. Java System Properties - aws.accessKeyId and aws.secretKey
        2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
        3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
        4. Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable is set and security manager has permission to access the variable.
        5. Instance profile credentials delivered through the Amazon EC2 metadata service

        If the credentials are not found in any of the locations above, an exception will be thrown at S3CrtAsyncClientBuilder.build() time.

        Specified by:
        credentialsProvider in interface S3CrtAsyncClientBuilder
        Parameters:
        credentialsProvider - the credentials to use
        Returns:
        This builder for method chaining.
      • region

        public S3CrtAsyncClientBuilder region​(Region region)
        Description copied from interface: S3CrtAsyncClientBuilder
        Configure the region with which the SDK should communicate.

        If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:

        1. Check the 'aws.region' system property for the region.
        2. Check the 'AWS_REGION' environment variable for the region.
        3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
        4. If running in EC2, check the EC2 metadata service for the region.
        Specified by:
        region in interface S3CrtAsyncClientBuilder
        Parameters:
        region - the region to be used
        Returns:
        this builder for method chaining.
      • minimumPartSizeInBytes

        public S3CrtAsyncClientBuilder minimumPartSizeInBytes​(Long partSizeBytes)
        Description copied from interface: S3CrtAsyncClientBuilder
        Sets the minimum part size for transfer parts. Decreasing the minimum part size causes multipart transfer to be split into a larger number of smaller parts. Setting this value too low has a negative effect on transfer speeds, causing extra latency and network communication for each part.

        By default, it is 8MB. See Amazon S3 multipart upload limits for guidance.

        Specified by:
        minimumPartSizeInBytes in interface S3CrtAsyncClientBuilder
        Parameters:
        partSizeBytes - The minimum part size for transfer parts.
        Returns:
        this builder for method chaining.
      • initialReadBufferSizeInBytes

        public S3CrtAsyncClientBuilder initialReadBufferSizeInBytes​(Long readBufferSizeInBytes)
        Description copied from interface: S3CrtAsyncClientBuilder
        Configure the starting buffer size the client will use to buffer the parts downloaded from S3. Maintain a larger window to keep up a high download throughput; parts cannot download in parallel unless the window is large enough to hold multiple parts. Maintain a smaller window to limit the amount of data buffered in memory.

        By default, it is equal to the resolved part size * 10

        Specified by:
        initialReadBufferSizeInBytes in interface S3CrtAsyncClientBuilder
        Parameters:
        readBufferSizeInBytes - the initial read buffer size
        Returns:
        this builder for method chaining.
      • crossRegionAccessEnabled

        public S3CrtAsyncClientBuilder crossRegionAccessEnabled​(Boolean crossRegionAccessEnabled)
        Description copied from interface: S3CrtAsyncClientBuilder

        Configures whether cross-region bucket access is enabled for clients using the configuration.

        The following behavior is used when this mode is enabled:

        1. This method allows enabling or disabling cross-region bucket access for clients. When cross-region bucket access is enabled, requests that do not act on an existing bucket (e.g., createBucket API) will be routed to the region configured on the client
        2. The first time a request is made that references an existing bucket (e.g., putObject API), a request will be made to the client-configured region. If the bucket does not exist in this region, the service will include the actual region in the error responses. Subsequently, the API will be called using the correct region obtained from the error response.
        3. This location may be cached in the client for subsequent requests to the same bucket.

        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

        Specified by:
        crossRegionAccessEnabled in interface S3CrtAsyncClientBuilder
        Parameters:
        crossRegionAccessEnabled - Whether cross region bucket access should be enabled.
        Returns:
        The builder object for method chaining.
      • thresholdInBytes

        public S3CrtAsyncClientBuilder thresholdInBytes​(Long thresholdInBytes)
        Description copied from interface: S3CrtAsyncClientBuilder
        Configure the size threshold, in bytes, for when to use multipart upload. Uploads/copies over this size will automatically use a multipart upload strategy, while uploads/copies smaller than this threshold will use a single connection to upload/copy the whole object.

        Multipart 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).

        Specified by:
        thresholdInBytes in interface S3CrtAsyncClientBuilder
        Parameters:
        thresholdInBytes - the value of the threshold to set.
        Returns:
        an instance of this builder.