(
self, call_args, submission_task_cls, extra_main_kwargs=None
)
| 524 | set_default_checksum_algorithm(extra_args) |
| 525 | |
| 526 | def _submit_transfer( |
| 527 | self, call_args, submission_task_cls, extra_main_kwargs=None |
| 528 | ): |
| 529 | register_feature_id('S3_TRANSFER') |
| 530 | if not extra_main_kwargs: |
| 531 | extra_main_kwargs = {} |
| 532 | |
| 533 | # Create a TransferFuture to return back to the user |
| 534 | transfer_future, components = self._get_future_with_components( |
| 535 | call_args |
| 536 | ) |
| 537 | |
| 538 | # Add any provided done callbacks to the created transfer future |
| 539 | # to be invoked on the transfer future being complete. |
| 540 | for callback in get_callbacks(transfer_future, 'done'): |
| 541 | components['coordinator'].add_done_callback(callback) |
| 542 | |
| 543 | # Get the main kwargs needed to instantiate the submission task |
| 544 | main_kwargs = self._get_submission_task_main_kwargs( |
| 545 | transfer_future, extra_main_kwargs |
| 546 | ) |
| 547 | |
| 548 | # Submit a SubmissionTask that will submit all of the necessary |
| 549 | # tasks needed to complete the S3 transfer. |
| 550 | self._submission_executor.submit( |
| 551 | submission_task_cls( |
| 552 | transfer_coordinator=components['coordinator'], |
| 553 | main_kwargs=main_kwargs, |
| 554 | ) |
| 555 | ) |
| 556 | |
| 557 | # Increment the unique id counter for future transfer requests |
| 558 | self._id_counter += 1 |
| 559 | |
| 560 | return transfer_future |
| 561 | |
| 562 | def _get_future_with_components(self, call_args): |
| 563 | transfer_id = self._id_counter |
no test coverage detected