Skip to content

Commit 79044be

Browse files
committed
Rename observer to weak ptr
1 parent ebb47af commit 79044be

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ DataTypePtr getComplexTypeFromObject(const Poco::JSON::Object::Ptr & type)
113113
struct DeltaLakeMetadataImpl
114114
{
115115
ObjectStoragePtr object_storage;
116-
StorageObjectStorageConfigurationObserverPtr configuration;
116+
StorageObjectStorageConfigurationWeakPtr configuration;
117117
ContextPtr context;
118118

119119
/**
120120
* Useful links:
121121
* - https://github.com/delta-io/delta/blob/master/PROTOCOL.md#data-files
122122
*/
123-
DeltaLakeMetadataImpl(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationObserverPtr configuration_, ContextPtr context_)
123+
DeltaLakeMetadataImpl(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationWeakPtr configuration_, ContextPtr context_)
124124
: object_storage(object_storage_), configuration(configuration_), context(context_)
125125
{
126126
}
@@ -602,7 +602,7 @@ struct DeltaLakeMetadataImpl
602602
LoggerPtr log = getLogger("DeltaLakeMetadataParser");
603603
};
604604

605-
DeltaLakeMetadata::DeltaLakeMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationObserverPtr configuration_, ContextPtr context_)
605+
DeltaLakeMetadata::DeltaLakeMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationWeakPtr configuration_, ContextPtr context_)
606606
{
607607
auto impl = DeltaLakeMetadataImpl(object_storage_, configuration_, context_);
608608
auto result = impl.processMetadataFiles();
@@ -617,7 +617,7 @@ DeltaLakeMetadata::DeltaLakeMetadata(ObjectStoragePtr object_storage_, StorageOb
617617

618618
DataLakeMetadataPtr DeltaLakeMetadata::create(
619619
ObjectStoragePtr object_storage,
620-
StorageObjectStorageConfigurationObserverPtr configuration,
620+
StorageObjectStorageConfigurationWeakPtr configuration,
621621
ContextPtr local_context)
622622
{
623623
#if USE_DELTA_KERNEL_RS

src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DeltaLakeMetadata final : public IDataLakeMetadata
3232
public:
3333
static constexpr auto name = "DeltaLake";
3434

35-
DeltaLakeMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationObserverPtr configuration_, ContextPtr context_);
35+
DeltaLakeMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationWeakPtr configuration_, ContextPtr context_);
3636

3737
NamesAndTypesList getTableSchema() const override { return schema; }
3838

@@ -48,7 +48,7 @@ class DeltaLakeMetadata final : public IDataLakeMetadata
4848

4949
static DataLakeMetadataPtr create(
5050
ObjectStoragePtr object_storage,
51-
StorageObjectStorageConfigurationObserverPtr configuration,
51+
StorageObjectStorageConfigurationWeakPtr configuration,
5252
ContextPtr local_context);
5353

5454
static DataTypePtr getFieldType(const Poco::JSON::Object::Ptr & field, const String & type_key, bool is_nullable);

src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadataDeltaKernel.cpp

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

1212
DeltaLakeMetadataDeltaKernel::DeltaLakeMetadataDeltaKernel(
1313
ObjectStoragePtr object_storage,
14-
StorageObjectStorageConfigurationObserverPtr configuration_)
14+
StorageObjectStorageConfigurationWeakPtr configuration_)
1515
: log(getLogger("DeltaLakeMetadata"))
1616
, table_snapshot(
1717
std::make_shared<DeltaLake::TableSnapshot>(

src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadataDeltaKernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DeltaLakeMetadataDeltaKernel final : public IDataLakeMetadata
2626

2727
DeltaLakeMetadataDeltaKernel(
2828
ObjectStoragePtr object_storage_,
29-
StorageObjectStorageConfigurationObserverPtr configuration_);
29+
StorageObjectStorageConfigurationWeakPtr configuration_);
3030

3131
bool supportsUpdate() const override { return true; }
3232

@@ -46,7 +46,7 @@ class DeltaLakeMetadataDeltaKernel final : public IDataLakeMetadata
4646

4747
static DataLakeMetadataPtr create(
4848
ObjectStoragePtr object_storage,
49-
StorageObjectStorageConfigurationObserverPtr configuration,
49+
StorageObjectStorageConfigurationWeakPtr configuration,
5050
ContextPtr /* context */)
5151
{
5252
auto configuration_ptr = configuration.lock();

src/Storages/ObjectStorage/DataLakes/HudiMetadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Strings HudiMetadata::getDataFilesImpl() const
8686
return result;
8787
}
8888

89-
HudiMetadata::HudiMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationObserverPtr configuration_, ContextPtr context_)
89+
HudiMetadata::HudiMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationWeakPtr configuration_, ContextPtr context_)
9090
: WithContext(context_), object_storage(object_storage_), configuration(configuration_)
9191
{
9292
}

src/Storages/ObjectStorage/DataLakes/HudiMetadata.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class HudiMetadata final : public IDataLakeMetadata, private WithContext
1515
public:
1616
static constexpr auto name = "Hudi";
1717

18-
HudiMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationObserverPtr configuration_, ContextPtr context_);
18+
HudiMetadata(ObjectStoragePtr object_storage_, StorageObjectStorageConfigurationWeakPtr configuration_, ContextPtr context_);
1919

2020
NamesAndTypesList getTableSchema() const override { return {}; }
2121

@@ -29,7 +29,7 @@ class HudiMetadata final : public IDataLakeMetadata, private WithContext
2929

3030
static DataLakeMetadataPtr create(
3131
ObjectStoragePtr object_storage,
32-
StorageObjectStorageConfigurationObserverPtr configuration,
32+
StorageObjectStorageConfigurationWeakPtr configuration,
3333
ContextPtr local_context)
3434
{
3535
return std::make_unique<HudiMetadata>(object_storage, configuration, local_context);
@@ -44,7 +44,7 @@ class HudiMetadata final : public IDataLakeMetadata, private WithContext
4444

4545
private:
4646
const ObjectStoragePtr object_storage;
47-
const StorageObjectStorageConfigurationObserverPtr configuration;
47+
const StorageObjectStorageConfigurationWeakPtr configuration;
4848
mutable Strings data_files;
4949

5050
Strings getDataFilesImpl() const;

src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Poco::JSON::Object::Ptr getMetadataJSONObject(
147147

148148
IcebergMetadata::IcebergMetadata(
149149
ObjectStoragePtr object_storage_,
150-
StorageObjectStorageConfigurationObserverPtr configuration_,
150+
StorageObjectStorageConfigurationWeakPtr configuration_,
151151
const ContextPtr & context_,
152152
Int32 metadata_version_,
153153
Int32 format_version_,
@@ -686,7 +686,7 @@ std::optional<Int32> IcebergMetadata::getSchemaVersionByFileIfOutdated(String da
686686

687687
DataLakeMetadataPtr IcebergMetadata::create(
688688
const ObjectStoragePtr & object_storage,
689-
const StorageObjectStorageConfigurationObserverPtr & configuration,
689+
const StorageObjectStorageConfigurationWeakPtr & configuration,
690690
const ContextPtr & local_context)
691691
{
692692
auto configuration_ptr = configuration.lock();

src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class IcebergMetadata : public IDataLakeMetadata
3636

3737
IcebergMetadata(
3838
ObjectStoragePtr object_storage_,
39-
StorageObjectStorageConfigurationObserverPtr configuration_,
39+
StorageObjectStorageConfigurationWeakPtr configuration_,
4040
const ContextPtr & context_,
4141
Int32 metadata_version_,
4242
Int32 format_version_,
@@ -54,7 +54,7 @@ class IcebergMetadata : public IDataLakeMetadata
5454

5555
static DataLakeMetadataPtr create(
5656
const ObjectStoragePtr & object_storage,
57-
const StorageObjectStorageConfigurationObserverPtr & configuration,
57+
const StorageObjectStorageConfigurationWeakPtr & configuration,
5858
const ContextPtr & local_context);
5959

6060
std::shared_ptr<NamesAndTypesList> getInitialSchemaByPath(ContextPtr local_context, const String & data_path) const override;
@@ -82,7 +82,7 @@ class IcebergMetadata : public IDataLakeMetadata
8282

8383
private:
8484
const ObjectStoragePtr object_storage;
85-
const StorageObjectStorageConfigurationObserverPtr configuration;
85+
const StorageObjectStorageConfigurationWeakPtr configuration;
8686
mutable IcebergSchemaProcessor schema_processor;
8787
LoggerPtr log;
8888

src/Storages/ObjectStorage/StorageObjectStorageConfiguration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class StorageObjectStorageConfiguration
158158
};
159159

160160
using StorageObjectStorageConfigurationPtr = std::shared_ptr<StorageObjectStorageConfiguration>;
161-
using StorageObjectStorageConfigurationObserverPtr = std::weak_ptr<StorageObjectStorageConfiguration>;
161+
using StorageObjectStorageConfigurationWeakPtr = std::weak_ptr<StorageObjectStorageConfiguration>;
162162

163163

164164
}

0 commit comments

Comments
 (0)