public class DownloadConfiguration extends Object
Configuration for the DownloadManager
.
Modifier and Type | Class and Description |
---|---|
static class |
DownloadConfiguration.Builder
Builder for
DownloadConfiguration . |
Constructor and Description |
---|
DownloadConfiguration(int maxRetries,
Duration initialBackoff,
Duration maxBackoff,
int partSizeInBytes,
long multipartDownloadThresholdInBytes,
int parallelDownloads,
ExecutorService executorService)
Create a configuration for the
DownloadManager . |
DownloadConfiguration(int maxRetries,
Duration initialBackoff,
Duration maxBackoff,
int partSizeInBytes,
long multipartDownloadThresholdInBytes,
int parallelDownloads,
ExecutorService executorService,
boolean enforceDataIntegrityForDownload)
Create a configuration for the
DownloadManager with a flag to enforce data integrity
for downloads. |
Modifier and Type | Method and Description |
---|---|
static DownloadConfiguration.Builder |
builder()
Create a new builder for the
DownloadManager configuration |
ExecutorService |
getExecutorService()
Executor service for parallel downloads.
|
Duration |
getInitialBackoff()
Initial backoff, before a retry is performed.
|
Duration |
getMaxBackoff()
Maximum backoff between retries.
|
int |
getMaxRetries()
Maximum number of retries, not including the initial attempt.
|
long |
getMultipartDownloadThresholdInBytes()
The threshold size in bytes at which we will start splitting the object into parts.
|
int |
getParallelDownloads()
The number of parallel operations to perform when downloading an object in multiple parts.
|
int |
getPartSizeInBytes()
The size in bytes of the individual parts as which the object is downloaded.
|
boolean |
isEnforceDataIntegrityForDownload()
Flag to indicate whether download integrity verification should be enabled.
|
public DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService)
Create a configuration for the DownloadManager
.
maxRetries
- maximum number of retries, not including the initial attempt.initialBackoff
- initial backoff, before a retry is performed.maxBackoff
- maximum backoff between retriespartSizeInBytes
- the size in bytes of the individual parts as which the object is
downloaded.multipartDownloadThresholdInBytes
- the threshold size in bytes at which we will start
splitting the object into partsparallelDownloads
- maximum number of parallel downloadsexecutorService
- executor service for parallel downloadspublic DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService, boolean enforceDataIntegrityForDownload)
Create a configuration for the DownloadManager
with a flag to enforce data integrity
for downloads.
maxRetries
- maximum number of retries, not including the initial attempt.initialBackoff
- initial backoff, before a retry is performed.maxBackoff
- maximum backoff between retriespartSizeInBytes
- the size in bytes of the individual parts as which the object is
downloaded.multipartDownloadThresholdInBytes
- the threshold size in bytes at which we will start
splitting the object into partsparallelDownloads
- maximum number of parallel downloadsexecutorService
- executor service for parallel downloadsenforceDataIntegrityForDownload
- flag to enable or disable data integrity verification
for downloadspublic static DownloadConfiguration.Builder builder()
Create a new builder for the DownloadManager
configuration
public int getMaxRetries()
Maximum number of retries, not including the initial attempt.
public Duration getInitialBackoff()
Initial backoff, before a retry is performed.
public Duration getMaxBackoff()
Maximum backoff between retries.
public int getPartSizeInBytes()
The size in bytes of the individual parts as which the object is downloaded.
public long getMultipartDownloadThresholdInBytes()
The threshold size in bytes at which we will start splitting the object into parts.
public int getParallelDownloads()
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.
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 DownloadConfiguration.Builder.executorService(ExecutorService)
that limits the number of threads.
public ExecutorService getExecutorService()
Executor service for parallel downloads.
public boolean isEnforceDataIntegrityForDownload()
Flag to indicate whether download integrity verification should be enabled.
Copyright © 2016–2024. All rights reserved.