public static class DownloadConfiguration.Builder extends Object
Builder for DownloadConfiguration
.
Modifier and Type | Method and Description |
---|---|
DownloadConfiguration |
build()
Build the
DownloadConfiguration . |
DownloadConfiguration.Builder |
copy(DownloadConfiguration that)
Copy the values from a
DownloadConfiguration into this builder |
DownloadConfiguration.Builder |
executorService(ExecutorService value)
The executor service to use when performing parallel operations.
|
DownloadConfiguration.Builder |
initialBackoff(Duration value)
Set the initial backoff before the first retry.
|
DownloadConfiguration.Builder |
maxBackoff(Duration value)
Set the maximum backoff between retries.
|
DownloadConfiguration.Builder |
maxRetries(int value)
Maximum number of retries to attempt when downloading an object/part.
|
DownloadConfiguration.Builder |
multipartDownloadThresholdInBytes(long value)
Objects larger than this size will be downloaded in multiple parts.
|
DownloadConfiguration.Builder |
parallelDownloads(int value)
The number of parallel operations to perform when downloading an object in multiple
parts.
|
DownloadConfiguration.Builder |
partSizeInBytes(int value)
Set the part size to use when downloading an object in multiple parts.
|
public DownloadConfiguration build()
Build the DownloadConfiguration
.
DownloadConfiguration
public DownloadConfiguration.Builder copy(DownloadConfiguration that)
Copy the values from a DownloadConfiguration
into this builder
that
- other DownloadConfiguration
public DownloadConfiguration.Builder maxRetries(int value)
Maximum number of retries to attempt when downloading an object/part. The default value is 10 retries.
The retries in the download manager are smarter than the retries built into the client: The download manager modifies the request to only retry the parts that haven't been read yet. The client would retry the entire request, and re-download parts that have already been downloaded.
Since these retries have been implemented independent of the regular client retries,
client retries set using RetryConfiguration
are ignored.
value
- public DownloadConfiguration.Builder initialBackoff(Duration value)
Set the initial backoff before the first retry.
value
- initial backoff before the first retrypublic DownloadConfiguration.Builder maxBackoff(Duration value)
Set the maximum backoff between retries.
value
- maximum backoff between retriespublic DownloadConfiguration.Builder partSizeInBytes(int value)
Set the part size to use when downloading an object in multiple parts. The default value is 32 MiB, the minimum allowable size is 4 MiB, and the maximum allowable size is 1 GiB.
value
- the size in bytes of the individual parts as which the object is downloaded.public DownloadConfiguration.Builder multipartDownloadThresholdInBytes(long value)
Objects larger than this size will be downloaded in multiple parts. The default value is 64 MiB, the minimum allowable threshold is 4 MiB, and the maximum allowable threshold is 5 GiB.
value
- the threshold size in bytes at which we will start splitting the object into
partspublic DownloadConfiguration.Builder parallelDownloads(int value)
The number of parallel operations to perform when downloading an object in multiple parts. Decreasing this value will make multipart downloads less resource intensive but they may take longer. Increasing this value may improve download times, but the download process will consume more system resources and network bandwidth. The maximum allowed value is 256 and the default value is 3.
Note that this is per object. If you call DownloadManager.getObject(GetObjectRequest)
multiple times concurrently from separate
threads, you will get this many parallel operations per object. If you want to limit the
overall number of parallel parts being downloaded, you can provide an ExecutorService
using executorService(ExecutorService)
that limits the number
of threads.
value
- maximum number of parallel operations when downloading a single objectpublic DownloadConfiguration.Builder executorService(ExecutorService value)
The executor service to use when performing parallel operations. If this is null (the default) each download will create its own executor service if necessary.
value
- executor service for parallel downloadsCopyright © 2016–2024. All rights reserved.