Interface MultipartConfiguration.Builder

    • Method Detail

      • thresholdInBytes

        MultipartConfiguration.Builder thresholdInBytes​(Long thresholdInBytes)
        Configure the size threshold, in bytes, for when to use multipart upload. Uploads/copies over this size will automatically use a multipart upload strategy, while uploads/copies smaller than this threshold will use a single connection to upload/copy the whole object.

        Multipart uploads are easier to recover from and also potentially faster than single part uploads, especially when the upload parts can be uploaded in parallel. Because there are additional network API calls, small objects are still recommended to use a single connection for the upload. See Uploading and copying objects using multipart upload.

        By default, it is the same as minimumPartSizeInBytes(Long).

        Parameters:
        thresholdInBytes - the value of the threshold to set.
        Returns:
        an instance of this builder.
      • thresholdInBytes

        Long thresholdInBytes()
        Indicates the value of the configured threshold.
        Returns:
        the value of the threshold.
      • minimumPartSizeInBytes

        MultipartConfiguration.Builder minimumPartSizeInBytes​(Long minimumPartSizeInBytes)
        Configures the part size, in bytes, to be used in each individual part requests. Only used for putObject and copyObject operations.

        When uploading large payload, the size of the payload of each individual part requests might actually be bigger than the configured value since there is a limit to the maximum number of parts possible per multipart request. If the configured part size would lead to a number of parts higher than the maximum allowed, a larger part size will be calculated instead to allow fewer part to be uploaded, to avoid the limit imposed on the maximum number of parts.

        In the case where the minimumPartSizeInBytes is set to a value higher than the thresholdInBytes, when the client receive a request with a size smaller than a single part multipart operation will NOT be performed even if the size of the request is larger than the threshold.

        Default value: 8 Mib

        Parameters:
        minimumPartSizeInBytes - the value of the part size to set
        Returns:
        an instance of this builder.
      • minimumPartSizeInBytes

        Long minimumPartSizeInBytes()
        Indicated the value of the part configured size.
        Returns:
        the value of the part size
      • apiCallBufferSizeInBytes

        MultipartConfiguration.Builder apiCallBufferSizeInBytes​(Long apiCallBufferSizeInBytes)
        Configures the maximum amount of memory, in bytes, the SDK will use to buffer content of requests in memory. Increasing this value may lead to better performance at the cost of using more memory.

        Default value: If not specified, the SDK will use the equivalent of four parts worth of memory, so 32 Mib by default.

        Parameters:
        apiCallBufferSizeInBytes - the value of the maximum memory usage.
        Returns:
        an instance of this builder.
      • apiCallBufferSizeInBytes

        Long apiCallBufferSizeInBytes()
        Indicates the value of the maximum memory usage that the SDK will use.
        Returns:
        the value of the maximum memory usage.