Class DownloadConfiguration

    • Constructor Detail

      • DownloadConfiguration

        public DownloadConfiguration​(int maxRetries,
                                     Duration initialBackoff,
                                     Duration maxBackoff,
                                     int partSizeInBytes,
                                     long multipartDownloadThresholdInBytes,
                                     int parallelDownloads,
                                     ExecutorService executorService)
        Create a configuration for the DownloadManager.
        Parameters:
        maxRetries - maximum number of retries, not including the initial attempt.
        initialBackoff - initial backoff, before a retry is performed.
        maxBackoff - maximum backoff between retries
        partSizeInBytes - 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 parts
        parallelDownloads - maximum number of parallel downloads
        executorService - 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 the DownloadManager 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 retries
        partSizeInBytes - 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 parts
        parallelDownloads - maximum number of parallel downloads
        executorService - executor service for parallel downloads
        enforceDataIntegrityForDownload - flag to enable or disable data integrity verification for downloads
    • Method Detail

      • 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 an ExecutorService using DownloadConfiguration.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.