MCPcopy Create free account
hub / github.com/aws/aws-cli / adjust_chunksize

Method adjust_chunksize

awscli/s3transfer/utils.py:763–778  ·  view source on GitHub ↗

Get a chunksize close to current that fits within all S3 limits. :type current_chunksize: int :param current_chunksize: The currently configured chunksize. :type file_size: int or None :param file_size: The size of the file to upload. This might be None

(self, current_chunksize, file_size=None)

Source from the content-addressed store, hash-verified

761 self.max_parts = max_parts
762
763 def adjust_chunksize(self, current_chunksize, file_size=None):
764 """Get a chunksize close to current that fits within all S3 limits.
765
766 :type current_chunksize: int
767 :param current_chunksize: The currently configured chunksize.
768
769 :type file_size: int or None
770 :param file_size: The size of the file to upload. This might be None
771 if the object being transferred has an unknown size.
772
773 :returns: A valid chunksize that fits within configured limits.
774 """
775 chunksize = current_chunksize
776 if file_size is not None:
777 chunksize = self._adjust_for_max_parts(chunksize, file_size)
778 return self._adjust_for_chunksize_limits(chunksize)
779
780 def _adjust_for_chunksize_limits(self, current_chunksize):
781 if current_chunksize > self.max_size:

Calls 2

_adjust_for_max_partsMethod · 0.95