(
self,
client,
config,
osutil,
request_executor,
transfer_future,
upload_input_manager,
)
| 661 | ) |
| 662 | |
| 663 | def _submit_multipart_request( |
| 664 | self, |
| 665 | client, |
| 666 | config, |
| 667 | osutil, |
| 668 | request_executor, |
| 669 | transfer_future, |
| 670 | upload_input_manager, |
| 671 | ): |
| 672 | call_args = transfer_future.meta.call_args |
| 673 | |
| 674 | # When a user provided checksum is passed, set "ChecksumType" to "FULL_OBJECT" |
| 675 | # and "ChecksumAlgorithm" to the related algorithm. |
| 676 | for checksum in FULL_OBJECT_CHECKSUM_ARGS: |
| 677 | if checksum in call_args.extra_args: |
| 678 | call_args.extra_args["ChecksumType"] = "FULL_OBJECT" |
| 679 | call_args.extra_args["ChecksumAlgorithm"] = checksum.replace( |
| 680 | "Checksum", "" |
| 681 | ) |
| 682 | |
| 683 | create_multipart_extra_args = self._extra_create_multipart_args( |
| 684 | call_args.extra_args |
| 685 | ) |
| 686 | |
| 687 | # Submit the request to create a multipart upload. |
| 688 | create_multipart_future = self._transfer_coordinator.submit( |
| 689 | request_executor, |
| 690 | CreateMultipartUploadTask( |
| 691 | transfer_coordinator=self._transfer_coordinator, |
| 692 | main_kwargs={ |
| 693 | 'client': client, |
| 694 | 'bucket': call_args.bucket, |
| 695 | 'key': call_args.key, |
| 696 | 'extra_args': create_multipart_extra_args, |
| 697 | }, |
| 698 | ), |
| 699 | ) |
| 700 | |
| 701 | # Submit requests to upload the parts of the file. |
| 702 | part_futures = [] |
| 703 | extra_part_args = self._extra_upload_part_args(call_args.extra_args) |
| 704 | |
| 705 | # Get any tags that need to be associated to the submitted task |
| 706 | # for upload the data |
| 707 | upload_part_tag = self._get_upload_task_tag( |
| 708 | upload_input_manager, 'upload_part' |
| 709 | ) |
| 710 | |
| 711 | size = transfer_future.meta.size |
| 712 | adjuster = ChunksizeAdjuster() |
| 713 | chunksize = adjuster.adjust_chunksize(config.multipart_chunksize, size) |
| 714 | part_iterator = upload_input_manager.yield_upload_part_bodies( |
| 715 | transfer_future, chunksize |
| 716 | ) |
| 717 | |
| 718 | for part_number, fileobj in part_iterator: |
| 719 | part_futures.append( |
| 720 | self._transfer_coordinator.submit( |
no test coverage detected