Style check fixes

This commit is contained in:
alesapin 2022-05-14 13:46:47 +02:00
parent cc304a3178
commit 4540cf8925
6 changed files with 35 additions and 35 deletions

View File

@ -29,7 +29,8 @@ namespace ErrorCodes
extern const int FILE_DOESNT_EXIST; extern const int FILE_DOESNT_EXIST;
extern const int BAD_FILE_TYPE; extern const int BAD_FILE_TYPE;
extern const int MEMORY_LIMIT_EXCEEDED; extern const int MEMORY_LIMIT_EXCEEDED;
extern const int SUPPORT_IS_DISABLED; extern const int BAD_ARGUMENTS;
extern const int LOGICAL_ERROR;
} }
static String revisionToString(UInt64 revision) static String revisionToString(UInt64 revision)

View File

@ -290,7 +290,7 @@ public:
virtual bool isReadOnly() const { return false; } virtual bool isReadOnly() const { return false; }
/// Check if disk is broken. Broken disks will have 0 space and connot be used. /// Check if disk is broken. Broken disks will have 0 space and cannot be used.
virtual bool isBroken() const { return false; } virtual bool isBroken() const { return false; }
/// Invoked when Global Context is shutdown. /// Invoked when Global Context is shutdown.

View File

@ -5,6 +5,11 @@
namespace DB namespace DB
{ {
namespace ErrorCodes
{
extern const int BAD_ARGUMENTS;
}
std::unique_ptr<S3ObjectStorageSettings> getSettings(const Poco::Util::AbstractConfiguration & config, const String & config_prefix, ContextPtr context) std::unique_ptr<S3ObjectStorageSettings> getSettings(const Poco::Util::AbstractConfiguration & config, const String & config_prefix, ContextPtr context)
{ {
S3Settings::ReadWriteSettings rw_settings; S3Settings::ReadWriteSettings rw_settings;

View File

@ -35,10 +35,6 @@ namespace DB
namespace ErrorCodes namespace ErrorCodes
{ {
extern const int S3_ERROR; extern const int S3_ERROR;
extern const int FILE_ALREADY_EXISTS;
extern const int UNKNOWN_FORMAT;
extern const int BAD_ARGUMENTS;
extern const int LOGICAL_ERROR;
} }
namespace namespace
@ -82,14 +78,10 @@ bool S3ObjectStorage::exists(const std::string & path) const
if (!object_head.IsSuccess()) if (!object_head.IsSuccess())
{ {
if (object_head.GetError().GetErrorType() == Aws::S3::S3Errors::RESOURCE_NOT_FOUND) if (object_head.GetError().GetErrorType() == Aws::S3::S3Errors::RESOURCE_NOT_FOUND)
{
LOG_DEBUG(&Poco::Logger::get("DEBUG"), "OBJECT DOESNT {} EXISTS", path);
return false; return false;
}
throwIfError(object_head); throwIfError(object_head);
} }
LOG_DEBUG(&Poco::Logger::get("DEBUG"), "OBJECT {} EXISTS", path);
return true; return true;
} }
@ -102,31 +94,31 @@ std::unique_ptr<ReadBufferFromFileBase> S3ObjectStorage::readObjects( /// NOLINT
std::optional<size_t>) const std::optional<size_t>) const
{ {
ReadSettings disk_read_settings{read_settings}; ReadSettings disk_read_settings{read_settings};
if (cache) if (cache)
{ {
if (IFileCache::isReadOnly()) if (IFileCache::isReadOnly())
disk_read_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache = true; disk_read_settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache = true;
disk_read_settings.remote_fs_cache = cache; disk_read_settings.remote_fs_cache = cache;
} }
auto settings_ptr = s3_settings.get(); auto settings_ptr = s3_settings.get();
auto s3_impl = std::make_unique<ReadBufferFromS3Gather>( auto s3_impl = std::make_unique<ReadBufferFromS3Gather>(
client.get(), bucket, version_id, common_path_prefix, blobs_to_read, client.get(), bucket, version_id, common_path_prefix, blobs_to_read,
settings_ptr->s3_settings.max_single_read_retries, disk_read_settings); settings_ptr->s3_settings.max_single_read_retries, disk_read_settings);
if (read_settings.remote_fs_method == RemoteFSReadMethod::threadpool) if (read_settings.remote_fs_method == RemoteFSReadMethod::threadpool)
{ {
auto reader = getThreadPoolReader(); auto reader = getThreadPoolReader();
return std::make_unique<AsynchronousReadIndirectBufferFromRemoteFS>(reader, disk_read_settings, std::move(s3_impl)); return std::make_unique<AsynchronousReadIndirectBufferFromRemoteFS>(reader, disk_read_settings, std::move(s3_impl));
} }
else else
{ {
auto buf = std::make_unique<ReadIndirectBufferFromRemoteFS>(std::move(s3_impl)); auto buf = std::make_unique<ReadIndirectBufferFromRemoteFS>(std::move(s3_impl));
return std::make_unique<SeekAvoidingReadBuffer>(std::move(buf), settings_ptr->min_bytes_for_seek); return std::make_unique<SeekAvoidingReadBuffer>(std::move(buf), settings_ptr->min_bytes_for_seek);
} }
} }
std::unique_ptr<SeekableReadBuffer> S3ObjectStorage::readObject( /// NOLINT std::unique_ptr<SeekableReadBuffer> S3ObjectStorage::readObject( /// NOLINT
@ -135,8 +127,8 @@ std::unique_ptr<SeekableReadBuffer> S3ObjectStorage::readObject( /// NOLINT
std::optional<size_t>, std::optional<size_t>,
std::optional<size_t>) const std::optional<size_t>) const
{ {
auto settings_ptr = s3_settings.get(); auto settings_ptr = s3_settings.get();
return std::make_unique<ReadBufferFromS3>(client.get(), bucket, path, version_id, settings_ptr->s3_settings.max_single_read_retries, read_settings); return std::make_unique<ReadBufferFromS3>(client.get(), bucket, path, version_id, settings_ptr->s3_settings.max_single_read_retries, read_settings);
} }

View File

@ -56,7 +56,7 @@ public:
, s3_settings(std::move(s3_settings_)) , s3_settings(std::move(s3_settings_))
, version_id(std::move(version_id_)) , version_id(std::move(version_id_))
{} {}
bool exists(const std::string & path) const override; bool exists(const std::string & path) const override;
std::unique_ptr<SeekableReadBuffer> readObject( /// NOLINT std::unique_ptr<SeekableReadBuffer> readObject( /// NOLINT

View File

@ -229,7 +229,9 @@ def test_insert_same_partition_and_merge(cluster, merge_vertical, node_name):
assert ( assert (
node.query("SELECT count(distinct(id)) FROM s3_test FORMAT Values") == "(8192)" node.query("SELECT count(distinct(id)) FROM s3_test FORMAT Values") == "(8192)"
) )
wait_for_delete_s3_objects(cluster, FILES_OVERHEAD_PER_PART_WIDE + FILES_OVERHEAD, timeout=45) wait_for_delete_s3_objects(
cluster, FILES_OVERHEAD_PER_PART_WIDE + FILES_OVERHEAD, timeout=45
)
@pytest.mark.parametrize("node_name", ["node"]) @pytest.mark.parametrize("node_name", ["node"])