1515# commands.
1616import logging
1717
18+ from botocore .utils import ensure_boolean
1819from s3transfer .manager import TransferConfig
1920
2021from awscli .customizations .s3 import constants
3132 'preferred_transfer_client' : constants .AUTO_RESOLVE_TRANSFER_CLIENT ,
3233 'target_bandwidth' : None ,
3334 'io_chunksize' : 256 * 1024 ,
35+ 'should_stream' : None ,
36+ 'disk_throughput' : None ,
37+ 'direct_io' : None ,
3438}
3539
3640
@@ -47,9 +51,18 @@ class RuntimeConfig:
4751 'max_bandwidth' ,
4852 'target_bandwidth' ,
4953 'io_chunksize' ,
54+ 'disk_throughput' ,
55+ ]
56+ HUMAN_READABLE_SIZES = [
57+ 'multipart_chunksize' ,
58+ 'multipart_threshold' ,
59+ 'io_chunksize' ,
60+ ]
61+ HUMAN_READABLE_RATES = [
62+ 'max_bandwidth' ,
63+ 'target_bandwidth' ,
64+ 'disk_throughput' ,
5065 ]
51- HUMAN_READABLE_SIZES = ['multipart_chunksize' , 'multipart_threshold' , 'io_chunksize' ]
52- HUMAN_READABLE_RATES = ['max_bandwidth' , 'target_bandwidth' ]
5366 SUPPORTED_CHOICES = {
5467 'preferred_transfer_client' : [
5568 constants .AUTO_RESOLVE_TRANSFER_CLIENT ,
@@ -62,6 +75,7 @@ class RuntimeConfig:
6275 'default' : constants .CLASSIC_TRANSFER_CLIENT
6376 }
6477 }
78+ BOOLEANS = ['should_stream' , 'direct_io' ]
6579
6680 @staticmethod
6781 def defaults ():
@@ -83,6 +97,7 @@ def build_config(self, **kwargs):
8397 runtime_config .update (kwargs )
8498 self ._convert_human_readable_sizes (runtime_config )
8599 self ._convert_human_readable_rates (runtime_config )
100+ self ._convert_booleans (runtime_config )
86101 self ._resolve_choice_aliases (runtime_config )
87102 self ._validate_config (runtime_config )
88103 return runtime_config
@@ -116,6 +131,12 @@ def _convert_human_readable_rates(self, runtime_config):
116131 'second (e.g. 10Mb/s or 800Kb/s)' % value
117132 )
118133
134+ def _convert_booleans (self , runtime_config ):
135+ for attr in self .BOOLEANS :
136+ value = runtime_config .get (attr )
137+ if value is not None :
138+ runtime_config [attr ] = ensure_boolean (value )
139+
119140 def _human_readable_rate_to_int (self , value ):
120141 # The human_readable_to_int() utility only supports integers (e.g. 1024)
121142 # as strings and human readable sizes (e.g. 10MB, 5GB). It does not
0 commit comments