Skip to content

Commit

Permalink
add multipart-chunksize parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
soaig authored and SoaigM committed Jul 25, 2024
1 parent 969e34f commit dc82837
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
'StorageConfig',
['bucket_name', 'key_file', 'prefix', 'fqdn', 'host_file_separator', 'storage_provider', 'storage_class',
'base_path', 'max_backup_age', 'max_backup_count', 'api_profile', 'transfer_max_bandwidth',
'concurrent_transfers', 'multi_part_upload_threshold', 'host', 'region', 'port', 'secure', 'ssl_verify',
'aws_cli_path', 'kms_id', 'backup_grace_period_in_days', 'use_sudo_for_restore', 'k8s_mode', 'read_timeout']
'concurrent_transfers', 'multi_part_upload_threshold', 'multipart_chunksize', 'host', 'region', 'port',
'secure', 'ssl_verify', 'aws_cli_path', 'kms_id', 'backup_grace_period_in_days', 'use_sudo_for_restore',
'k8s_mode', 'read_timeout']
)

CassandraConfig = collections.namedtuple(
Expand Down
4 changes: 4 additions & 0 deletions medusa/storage/s3_base_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def _make_connection_arguments(self, config) -> t.Dict[str, str]:
def _make_transfer_config(self, config):

transfer_max_bandwidth = config.transfer_max_bandwidth or None
multipart_chunksize = config.multipart_chunksize or None

# we hard-code this one because the parallelism is for now applied to chunking the files
transfer_config = {
Expand All @@ -194,6 +195,9 @@ def _make_transfer_config(self, config):
if transfer_max_bandwidth is not None:
transfer_config['max_bandwidth'] = AbstractStorage._human_size_to_bytes(transfer_max_bandwidth)

if multipart_chunksize is not None:
transfer_config['multipart_chunksize'] = AbstractStorage._human_size_to_bytes(multipart_chunksize)

return TransferConfig(**transfer_config)

@staticmethod
Expand Down

0 comments on commit dc82837

Please sign in to comment.