Skip to content

Commit

Permalink
add configuration for MPU threshold for CRT
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Sep 25, 2024
1 parent f2f935a commit cced7ed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ namespace Aws
uint32_t maxBackoffSecs = 20;
} config;
} crtRetryStrategyConfig;

/**
* The size threshold in bytes for when to use multipart uploads.
* Uploads larger than this will use the multipart upload strategy.
* Uploads smaller or equal to this will use a single HTTP request.
* If set, this should be at least `partSize`.
* If not set, the max of `partSize` and 5 MiB will be used.
*/
size_t multipartUploadThreshold = std::max(partSize, 5ul * 1024ul * 1024ul);
/* End of S3 CRT specifics */
private:
void LoadS3CrtSpecificConfig(const Aws::String& profileName);
Expand Down
1 change: 1 addition & 0 deletions generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ void S3CrtClient::init(const S3Crt::ClientConfiguration& config,

static const size_t DEFAULT_PART_SIZE = 8 * 1024 * 1024; // 8MB
s3CrtConfig.part_size = config.partSize < DEFAULT_PART_SIZE ? DEFAULT_PART_SIZE : config.partSize;
s3CrtConfig.multipart_upload_threshold = config.multipartUploadThreshold;

Aws::Crt::Io::TlsConnectionOptions *rawPTlsConnectionOptions = nullptr;
if (config.tlsConnectionOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,13 @@
uint32_t maxBackoffSecs = 20;
} config;
} crtRetryStrategyConfig;

/**
* The size threshold in bytes for when to use multipart uploads.
* Uploads larger than this will use the multipart upload strategy.
* Uploads smaller or equal to this will use a single HTTP request.
* If set, this should be at least `partSize`.
* If not set, the max of `partSize` and 5 MiB will be used.
*/
size_t multipartUploadThreshold = std::max(partSize, 5ul * 1024ul * 1024ul);
/* End of S3 CRT specifics */
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ void ${className}::init(const ${clientConfigurationNamespace}::ClientConfigurati

static const size_t DEFAULT_PART_SIZE = 8 * 1024 * 1024; // 8MB
s3CrtConfig.part_size = config.partSize < DEFAULT_PART_SIZE ? DEFAULT_PART_SIZE : config.partSize;
s3CrtConfig.multipart_upload_threshold = config.multipartUploadThreshold;

Aws::Crt::Io::TlsConnectionOptions *rawPTlsConnectionOptions = nullptr;
if (config.tlsConnectionOptions)
Expand Down

0 comments on commit cced7ed

Please sign in to comment.