mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
Add missing proper findOrGenerateImpl() implementation to MultipleAccessStorage class
This commit is contained in:
parent
f91d57adac
commit
7ffb618f6e
@ -104,6 +104,23 @@ std::optional<UUID> MultipleAccessStorage::findImpl(EntityType type, const Strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::optional<UUID> MultipleAccessStorage::findOrGenerateImpl(EntityType type, const String & name) const
|
||||||
|
{
|
||||||
|
auto storages = getStoragesInternal();
|
||||||
|
for (const auto & storage : *storages)
|
||||||
|
{
|
||||||
|
auto id = storage->findOrGenerate(type, name);
|
||||||
|
if (id)
|
||||||
|
{
|
||||||
|
std::lock_guard lock{mutex};
|
||||||
|
ids_cache.set(*id, storage);
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<UUID> MultipleAccessStorage::findAllImpl(EntityType type) const
|
std::vector<UUID> MultipleAccessStorage::findAllImpl(EntityType type) const
|
||||||
{
|
{
|
||||||
std::vector<UUID> all_ids;
|
std::vector<UUID> all_ids;
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::optional<UUID> findImpl(EntityType type, const String & name) const override;
|
std::optional<UUID> findImpl(EntityType type, const String & name) const override;
|
||||||
|
std::optional<UUID> findOrGenerateImpl(EntityType type, const String & name) const override;
|
||||||
std::vector<UUID> findAllImpl(EntityType type) const override;
|
std::vector<UUID> findAllImpl(EntityType type) const override;
|
||||||
bool existsImpl(const UUID & id) const override;
|
bool existsImpl(const UUID & id) const override;
|
||||||
AccessEntityPtr readImpl(const UUID & id) const override;
|
AccessEntityPtr readImpl(const UUID & id) const override;
|
||||||
|
Loading…
Reference in New Issue
Block a user