Skip to content

Commit 6cdecb2

Browse files
alesapinzvonand
authored andcommitted
Merge pull request ClickHouse#83599 from ClickHouse/move_configuration_to_separate_class
Move object storage configuration to separate class
1 parent f3e7171 commit 6cdecb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+422
-512
lines changed

src/Databases/DataLake/DatabaseDataLake.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ std::shared_ptr<DataLake::ICatalog> DatabaseDataLake::getCatalog() const
176176
return catalog_impl;
177177
}
178178

179-
std::shared_ptr<StorageObjectStorage::Configuration> DatabaseDataLake::getConfiguration(
179+
std::shared_ptr<StorageObjectStorageConfiguration> DatabaseDataLake::getConfiguration(
180180
DatabaseDataLakeStorageType type,
181181
DataLakeStorageSettingsPtr storage_settings) const
182182
{
@@ -428,7 +428,7 @@ StoragePtr DatabaseDataLake::tryGetTableImpl(const String & name, ContextPtr con
428428

429429
/// with_table_structure = false: because there will be
430430
/// no table structure in table definition AST.
431-
StorageObjectStorage::Configuration::initialize(*configuration, args, context_copy, /* with_table_structure */false);
431+
StorageObjectStorageConfiguration::initialize(*configuration, args, context_copy, /* with_table_structure */false);
432432

433433
return std::make_shared<StorageObjectStorage>(
434434
configuration,

src/Databases/DataLake/DatabaseDataLake.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class DatabaseDataLake final : public IDatabase, WithContext
7272
void validateSettings();
7373
std::shared_ptr<DataLake::ICatalog> getCatalog() const;
7474

75-
std::shared_ptr<StorageObjectStorage::Configuration> getConfiguration(
75+
std::shared_ptr<StorageObjectStorageConfiguration> getConfiguration(
7676
DatabaseDataLakeStorageType type,
7777
DataLakeStorageSettingsPtr storage_settings) const;
7878

src/Databases/DataLake/GlueCatalog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ bool GlueCatalog::classifyTimestampTZ(const String & column_name, const TableMet
441441
auto storage_settings = std::make_shared<DB::DataLakeStorageSettings>();
442442
storage_settings->loadFromSettingsChanges(settings.allChanged());
443443
auto configuration = std::make_shared<DB::StorageS3IcebergConfiguration>(storage_settings);
444-
DB::StorageObjectStorage::Configuration::initialize(*configuration, args, getContext(), false);
444+
DB::StorageObjectStorageConfiguration::initialize(*configuration, args, getContext(), false);
445445

446446
auto object_storage = configuration->createObjectStorage(getContext(), true);
447447
const auto & read_settings = getContext()->getReadSettings();

src/Storages/ObjectStorage/Azure/Configuration.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ void StorageAzureConfiguration::check(ContextPtr context) const
6363
{
6464
auto url = Poco::URI(connection_params.getConnectionURL());
6565
context->getGlobalContext()->getRemoteHostFilter().checkURL(url);
66-
Configuration::check(context);
66+
StorageObjectStorageConfiguration::check(context);
6767
}
6868

69-
StorageObjectStorage::QuerySettings StorageAzureConfiguration::getQuerySettings(const ContextPtr & context) const
69+
StorageObjectStorageQuerySettings StorageAzureConfiguration::getQuerySettings(const ContextPtr & context) const
7070
{
7171
const auto & settings = context->getSettingsRef();
72-
return StorageObjectStorage::QuerySettings{
72+
return StorageObjectStorageQuerySettings{
7373
.truncate_on_insert = settings[Setting::azure_truncate_on_insert],
7474
.create_new_file_on_insert = settings[Setting::azure_create_new_file_on_insert],
7575
.schema_inference_use_cache = settings[Setting::schema_inference_use_cache_for_azure],

src/Storages/ObjectStorage/Azure/Configuration.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ namespace DB
1212
{
1313
class BackupFactory;
1414

15-
class StorageAzureConfiguration : public StorageObjectStorage::Configuration
15+
class StorageAzureConfiguration : public StorageObjectStorageConfiguration
1616
{
1717
friend class BackupReaderAzureBlobStorage;
1818
friend class BackupWriterAzureBlobStorage;
1919
friend void registerBackupEngineAzureBlobStorage(BackupFactory & factory);
2020

2121
public:
22-
using ConfigurationPtr = StorageObjectStorage::ConfigurationPtr;
23-
2422
static constexpr auto type = ObjectStorageType::Azure;
2523
static constexpr auto type_name = "azure";
2624
static constexpr auto engine_name = "Azure";
@@ -74,7 +72,7 @@ class StorageAzureConfiguration : public StorageObjectStorage::Configuration
7472

7573
String getNamespace() const override { return connection_params.getContainer(); }
7674
String getDataSourceDescription() const override { return std::filesystem::path(connection_params.getConnectionURL()) / connection_params.getContainer(); }
77-
StorageObjectStorage::QuerySettings getQuerySettings(const ContextPtr &) const override;
75+
StorageObjectStorageQuerySettings getQuerySettings(const ContextPtr &) const override;
7876

7977
void check(ContextPtr context) const override;
8078

src/Storages/ObjectStorage/DataLakes/Common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace DB
1010

1111
std::vector<String> listFiles(
1212
const IObjectStorage & object_storage,
13-
const StorageObjectStorage::Configuration & configuration,
13+
const StorageObjectStorageConfiguration & configuration,
1414
const String & prefix, const String & suffix)
1515
{
1616
auto key = std::filesystem::path(configuration.getPathForRead().path) / prefix;

src/Storages/ObjectStorage/DataLakes/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class IObjectStorage;
99

1010
std::vector<String> listFiles(
1111
const IObjectStorage & object_storage,
12-
const StorageObjectStorage::Configuration & configuration,
12+
const StorageObjectStorageConfiguration & configuration,
1313
const String & prefix, const String & suffix);
1414

1515
}

src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ namespace DataLakeStorageSetting
3939

4040

4141
template <typename T>
42-
concept StorageConfiguration = std::derived_from<T, StorageObjectStorage::Configuration>;
42+
concept StorageConfiguration = std::derived_from<T, StorageObjectStorageConfiguration>;
4343

4444
template <StorageConfiguration BaseStorageConfiguration, typename DataLakeMetadata>
45-
class DataLakeConfiguration : public BaseStorageConfiguration, public std::enable_shared_from_this<StorageObjectStorage::Configuration>
45+
class DataLakeConfiguration : public BaseStorageConfiguration, public std::enable_shared_from_this<StorageObjectStorageConfiguration>
4646
{
4747
public:
48-
using Configuration = StorageObjectStorage::Configuration;
49-
5048
explicit DataLakeConfiguration(DataLakeStorageSettingsPtr settings_) : settings(settings_) {}
5149

5250
bool isDataLakeConfiguration() const override { return true; }

src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace S3AuthSetting
160160
}
161161

162162
DeltaLake::KernelHelperPtr getKernelHelper(
163-
const StorageObjectStorage::ConfigurationPtr & configuration,
163+
const StorageObjectStorageConfigurationPtr & configuration,
164164
const ObjectStoragePtr & object_storage)
165165
{
166166
switch (configuration->getType())

src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace DB
4747
/// Depending on the type of the passed StorageObjectStorage::IConfiguration object,
4848
/// it would create S3KernelHelper, AzureKernelHelper, etc.
4949
DeltaLake::KernelHelperPtr getKernelHelper(
50-
const StorageObjectStorage::ConfigurationPtr & configuration,
50+
const StorageObjectStorageConfigurationPtr & configuration,
5151
const ObjectStoragePtr & object_storage);
5252

5353
}

0 commit comments

Comments
 (0)