Remove extra compare operator. Review fixes.

This commit is contained in:
Nikolai Kochetov 2022-12-19 13:12:59 +00:00
parent 4032ee8203
commit a3226b2daf
3 changed files with 1 additions and 30 deletions

View File

@ -113,7 +113,7 @@ void WriteBufferFromS3::nextImpl()
if (multipart_upload_id.empty() && last_part_size > settings.max_single_part_upload_size) if (multipart_upload_id.empty() && last_part_size > settings.max_single_part_upload_size)
createMultipartUpload(); createMultipartUpload();
assert(upload_part_size>0); chassert(upload_part_size > 0);
if (!multipart_upload_id.empty() && last_part_size > upload_part_size) if (!multipart_upload_id.empty() && last_part_size > upload_part_size)
{ {
writePart(); writePart();

View File

@ -19,7 +19,6 @@ namespace ErrorCodes
} }
S3Settings::RequestSettings::PartUploadSettings::PartUploadSettings(const Settings & settings) S3Settings::RequestSettings::PartUploadSettings::PartUploadSettings(const Settings & settings)
: PartUploadSettings()
{ {
updateFromSettingsImpl(settings, false); updateFromSettingsImpl(settings, false);
validate(); validate();
@ -45,7 +44,6 @@ S3Settings::RequestSettings::PartUploadSettings::PartUploadSettings(
} }
S3Settings::RequestSettings::PartUploadSettings::PartUploadSettings(const NamedCollection & collection) S3Settings::RequestSettings::PartUploadSettings::PartUploadSettings(const NamedCollection & collection)
: PartUploadSettings()
{ {
min_upload_part_size = collection.getOrDefault<UInt64>("min_upload_part_size", min_upload_part_size); min_upload_part_size = collection.getOrDefault<UInt64>("min_upload_part_size", min_upload_part_size);
upload_part_size_multiply_factor = collection.getOrDefault<UInt64>("upload_part_size_multiply_factor", upload_part_size_multiply_factor); upload_part_size_multiply_factor = collection.getOrDefault<UInt64>("upload_part_size_multiply_factor", upload_part_size_multiply_factor);

View File

@ -37,17 +37,6 @@ struct S3Settings
size_t max_single_part_upload_size = 32 * 1024 * 1024; size_t max_single_part_upload_size = 32 * 1024 * 1024;
size_t max_single_operation_copy_size = 5ULL * 1024 * 1024 * 1024; size_t max_single_operation_copy_size = 5ULL * 1024 * 1024 * 1024;
inline bool operator==(const PartUploadSettings & other) const
{
return min_upload_part_size == other.min_upload_part_size
&& max_upload_part_size == other.max_upload_part_size
&& upload_part_size_multiply_factor == other.upload_part_size_multiply_factor
&& upload_part_size_multiply_parts_count_threshold == other.upload_part_size_multiply_parts_count_threshold
&& max_part_number == other.max_part_number
&& max_single_part_upload_size == other.max_single_part_upload_size
&& max_single_operation_copy_size == other.max_single_operation_copy_size;
}
void updateFromSettings(const Settings & settings) { updateFromSettingsImpl(settings, true); } void updateFromSettings(const Settings & settings) { updateFromSettingsImpl(settings, true); }
void validate(); void validate();
@ -79,17 +68,6 @@ struct S3Settings
const PartUploadSettings & getUploadSettings() const { return upload_settings; } const PartUploadSettings & getUploadSettings() const { return upload_settings; }
inline bool operator==(const RequestSettings & other) const
{
return upload_settings == other.upload_settings
&& max_single_read_retries == other.max_single_read_retries
&& max_connections == other.max_connections
&& check_objects_after_upload == other.check_objects_after_upload
&& max_unexpected_write_error_retries == other.max_unexpected_write_error_retries
&& get_request_throttler == other.get_request_throttler
&& put_request_throttler == other.put_request_throttler;
}
RequestSettings() = default; RequestSettings() = default;
explicit RequestSettings(const Settings & settings); explicit RequestSettings(const Settings & settings);
explicit RequestSettings(const NamedCollection & collection); explicit RequestSettings(const NamedCollection & collection);
@ -115,11 +93,6 @@ struct S3Settings
S3::AuthSettings auth_settings; S3::AuthSettings auth_settings;
RequestSettings request_settings; RequestSettings request_settings;
inline bool operator==(const S3Settings & other) const
{
return auth_settings == other.auth_settings && request_settings == other.request_settings;
}
}; };
/// Settings for the StorageS3. /// Settings for the StorageS3.