Class DownloadConfiguration
- java.lang.Object
-
- com.oracle.bmc.objectstorage.transfer.DownloadConfiguration
-
public class DownloadConfiguration extends Object
Configuration for theDownloadManager
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DownloadConfiguration.Builder
Builder forDownloadConfiguration
.
-
Constructor Summary
Constructors Constructor Description DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService)
Create a configuration for theDownloadManager
.DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService, boolean enforceDataIntegrityForDownload)
Create a configuration for theDownloadManager
with a flag to enforce data integrity for downloads.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DownloadConfiguration.Builder
builder()
Create a new builder for theDownloadManager
configurationExecutorService
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.
-
-
-
Constructor Detail
-
DownloadConfiguration
public DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService)
Create a configuration for theDownloadManager
.- Parameters:
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 downloads
-
DownloadConfiguration
public DownloadConfiguration(int maxRetries, Duration initialBackoff, Duration maxBackoff, int partSizeInBytes, long multipartDownloadThresholdInBytes, int parallelDownloads, ExecutorService executorService, boolean enforceDataIntegrityForDownload)
Create a configuration for theDownloadManager
with a flag to enforce data integrity for downloads.- Parameters:
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 downloads
-
-
Method Detail
-
builder
public static DownloadConfiguration.Builder builder()
Create a new builder for theDownloadManager
configuration- Returns:
- builder for the configuration
-
getMaxRetries
public int getMaxRetries()
Maximum number of retries, not including the initial attempt.
-
getInitialBackoff
public Duration getInitialBackoff()
Initial backoff, before a retry is performed.
-
getMaxBackoff
public Duration getMaxBackoff()
Maximum backoff between retries.
-
getPartSizeInBytes
public int getPartSizeInBytes()
The size in bytes of the individual parts as which the object is downloaded.
-
getMultipartDownloadThresholdInBytes
public long getMultipartDownloadThresholdInBytes()
The threshold size in bytes at which we will start splitting the object into parts.
-
getParallelDownloads
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 anExecutorService
usingDownloadConfiguration.Builder.executorService(ExecutorService)
that limits the number of threads.
-
getExecutorService
public ExecutorService getExecutorService()
Executor service for parallel downloads.
-
isEnforceDataIntegrityForDownload
public boolean isEnforceDataIntegrityForDownload()
Flag to indicate whether download integrity verification should be enabled.
-
-