Class S3ClientOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanlongintlongRetrieves the memory limit set for the CRT client in bytes.longlongbooleandoublewithClientBootstrap(ClientBootstrap clientBootstrap) withComputeContentMd5(Boolean computeContentMd5) withConnectTimeoutMs(int connectTimeoutMs) withCredentialsProvider(CredentialsProvider credentialsProvider) Deprecated.withEnableS3Express(boolean enableS3Express) To enable S3 Express support for client The typical usage for a S3 Express request is to set this to true and let the request to be signed withAwsSigningConfig.AwsSigningAlgorithm.SIGV4_S3EXPRESS, either from the client level signingConfig or override from request.withEndpoint(String endpoint) Deprecated.withHttpMonitoringOptions(HttpMonitoringOptions monitoringOptions) Options for detecting bad HTTP connections.withInitialReadWindowSize(long bytes) The starting size of each S3MetaRequest's flow-control window (if backpressure is enabled).withMaxConnections(int maxConnections) withMemoryLimitInBytes(long memoryLimitBytes) The amount of memory the CRT client is allowed to use.withMultipartUploadThreshold(long multipartUploadThreshold) withPartSize(long partSize) withProxyEnvironmentVariableSetting(HttpProxyEnvironmentVariableSetting httpProxyEnvironmentVariableSetting) withProxyOptions(HttpProxyOptions proxyOptions) withReadBackpressureEnabled(boolean enable) Set whether backpressure is enabled (false by default), to prevent response data downloading faster than you can handle it.withRegion(String region) withS3ExpressCredentialsProviderFactory(S3ExpressCredentialsProviderFactory s3expressCredentialsProviderFactory) withS3TcpKeepAliveOptions(S3TcpKeepAliveOptions tcpKeepAliveOptions) withSigningConfig(AwsSigningConfig signingConfig) The configuration related to signing used by S3 client.withStandardRetryOptions(StandardRetryOptions standardRetryOptions) withThroughputTargetGbps(double throughputTargetGbps) withTlsContext(TlsContext tlsContext)
-
Constructor Details
-
S3ClientOptions
public S3ClientOptions()
-
-
Method Details
-
withRegion
-
getRegion
-
withClientBootstrap
-
getClientBootstrap
-
withCredentialsProvider
Deprecated.Please usewithSigningConfig(AwsSigningConfig)instead. The credentials provider will be used to create the signing Config when the client was created. Client will use `AwsSigningConfig.getDefaultS3SigningConfig(region, credentialsProvider);` to create the signing config.- Parameters:
credentialsProvider- provide credentials for signing.- Returns:
- this
-
getCredentialsProvider
-
withSigningConfig
The configuration related to signing used by S3 client. `AwsSigningConfig.getDefaultS3SigningConfig(region, credentialsProvider);` can be used as helper to create the default configuration to be used for S3. In case of public object, or the http message already has a presigned URL, signing can be skipped. If not set, a default config will be used with anonymous credentials and skip signing the request. If set: - Credentials provider is required. Other configs are all optional, and will be default to what needs to sign the request for S3, only overrides when Non-zero/Not-empty is set. - S3 Client will derive the right config for signing process based on this. Notes: - For SIGV4_S3EXPRESS, S3 client will use the credentials in the config to derive the S3 Express credentials that are used in the signing process. - Client may make modifications to signing config before passing it on to signer.- Parameters:
signingConfig- configuration related to signing via an AWS signing process.- Returns:
- this
-
getSigningConfig
-
withPartSize
-
getPartSize
public long getPartSize() -
withMultipartUploadThreshold
-
getMultiPartUploadThreshold
public long getMultiPartUploadThreshold() -
withThroughputTargetGbps
-
getThroughputTargetGbps
public double getThroughputTargetGbps() -
withReadBackpressureEnabled
Set whether backpressure is enabled (false by default), to prevent response data downloading faster than you can handle it.If false, no backpressure is applied and data will download as fast as possible.
If true, each S3MetaRequest has a flow-control window that shrinks as response body data is downloaded (headers do not affect the window).
withInitialReadWindowSize(long)determines the starting size of each S3MetaRequest's window, in bytes. Data stops downloading data whenever the window reaches zero. Increment the window to keep data flowing by callingS3MetaRequest.incrementReadWindow(long), or by returning a size fromS3MetaRequestResponseHandler.onResponseBody(java.nio.ByteBuffer, long, long). 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.WARNING: This feature is experimental. Currently, backpressure is only applied to GetObject requests which are split into multiple parts, and you may still receive some data after the window reaches zero.
- Parameters:
enable- whether to enable or disable backpressure- Returns:
- this
-
getReadBackpressureEnabled
public boolean getReadBackpressureEnabled() -
withInitialReadWindowSize
The starting size of each S3MetaRequest's flow-control window (if backpressure is enabled).- Parameters:
bytes- size in bytes- Returns:
- this
- See Also:
-
getInitialReadWindowSize
public long getInitialReadWindowSize() -
withEndpoint
Deprecated. -
getEndpoint
-
withTlsContext
-
getTlsContext
-
withMaxConnections
-
getMaxConnections
public int getMaxConnections() -
withComputeContentMd5
-
getComputeContentMd5
-
withStandardRetryOptions
-
getStandardRetryOptions
-
withProxyOptions
-
getProxyOptions
-
withProxyEnvironmentVariableSetting
public S3ClientOptions withProxyEnvironmentVariableSetting(HttpProxyEnvironmentVariableSetting httpProxyEnvironmentVariableSetting) -
getHttpProxyEnvironmentVariableSetting
-
withConnectTimeoutMs
-
getConnectTimeoutMs
public int getConnectTimeoutMs() -
withS3TcpKeepAliveOptions
-
getTcpKeepAliveOptions
-
withHttpMonitoringOptions
Options for detecting bad HTTP connections. If the transfer throughput falls below the specified thresholds for long enough, the operation is retried on a new connection. If left unset, default values are used.- Parameters:
monitoringOptions- monitoring options- Returns:
- this
-
getMonitoringOptions
-
withEnableS3Express
To enable S3 Express support for client The typical usage for a S3 Express request is to set this to true and let the request to be signed withAwsSigningConfig.AwsSigningAlgorithm.SIGV4_S3EXPRESS, either from the client level signingConfig or override from request.- Parameters:
enableS3Express- To enable S3 Express support for client- Returns:
- this
-
getEnableS3Express
public boolean getEnableS3Express() -
withS3ExpressCredentialsProviderFactory
public S3ClientOptions withS3ExpressCredentialsProviderFactory(S3ExpressCredentialsProviderFactory s3expressCredentialsProviderFactory) -
getS3ExpressCredentialsProviderFactory
-
withMemoryLimitInBytes
The amount of memory the CRT client is allowed to use. The client makes a best-effort attempt at memory limiting but might exceed this limit in some cases. If not provided, the client calculates this optimally from other settings, such as targetThroughput. On a 64-bit system, the default is between 2Gib-8Gib. It must be at least 1GiB and will be capped to SIZE_MAX of the system.- Parameters:
memoryLimitBytes- Memory limit in bytes.- Returns:
- this
-
getMemoryLimitInBytes
public long getMemoryLimitInBytes()Retrieves the memory limit set for the CRT client in bytes. If not set, this will return 0.- Returns:
- long memory limit in bytes
-
withSigningConfig(AwsSigningConfig)instead.