Class DownloadConfiguration.Builder

    • Method Detail

      • maxRetries

        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.

        Parameters:
        value -
        Returns:
        this builder
      • initialBackoff

        public DownloadConfiguration.Builder initialBackoff​(Duration value)
        Set the initial backoff before the first retry.
        Parameters:
        value - initial backoff before the first retry
        Returns:
        this builder
      • maxBackoff

        public DownloadConfiguration.Builder maxBackoff​(Duration value)
        Set the maximum backoff between retries.
        Parameters:
        value - maximum backoff between retries
        Returns:
        this builder
      • partSizeInBytes

        public 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.

        Parameters:
        value - the size in bytes of the individual parts as which the object is downloaded.
        Returns:
        this builder
      • multipartDownloadThresholdInBytes

        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.

        Parameters:
        value - the threshold size in bytes at which we will start splitting the object into parts
        Returns:
        this builder
      • parallelDownloads

        public 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.

        Parameters:
        value - maximum number of parallel operations when downloading a single object
        Returns:
        this builder
      • executorService

        public 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.

        Parameters:
        value - executor service for parallel downloads
        Returns:
        this builder
      • enforceDataIntegrityForDownload

        public DownloadConfiguration.Builder enforceDataIntegrityForDownload​(boolean value)
        Set whether download integrity verification should be enabled.
        Parameters:
        value - true to enable data integrity verification for downloads, false otherwise
        Returns:
        this builder