mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Add IDatabaseTablesIterator::reset() interface
This commit is contained in:
parent
6dc5cb166f
commit
32c449c34f
@ -329,4 +329,10 @@ const StoragePtr & DatabaseLazyIterator::table() const
|
|||||||
return current_storage;
|
return current_storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DatabaseLazyIterator::reset()
|
||||||
|
{
|
||||||
|
if (current_storage)
|
||||||
|
current_storage.reset();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ public:
|
|||||||
bool isValid() const override;
|
bool isValid() const override;
|
||||||
const String & name() const override;
|
const String & name() const override;
|
||||||
const StoragePtr & table() const override;
|
const StoragePtr & table() const override;
|
||||||
|
void reset() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const DatabaseLazy & database;
|
const DatabaseLazy & database;
|
||||||
|
@ -44,6 +44,8 @@ public:
|
|||||||
/// (a database with support for lazy tables loading
|
/// (a database with support for lazy tables loading
|
||||||
/// - it maintains a list of tables but tables are loaded lazily).
|
/// - it maintains a list of tables but tables are loaded lazily).
|
||||||
virtual const StoragePtr & table() const = 0;
|
virtual const StoragePtr & table() const = 0;
|
||||||
|
/// Reset reference counter to the StoragePtr.
|
||||||
|
virtual void reset() = 0;
|
||||||
|
|
||||||
virtual ~IDatabaseTablesIterator() = default;
|
virtual ~IDatabaseTablesIterator() = default;
|
||||||
|
|
||||||
@ -93,6 +95,8 @@ public:
|
|||||||
const String & name() const override { return it->first; }
|
const String & name() const override { return it->first; }
|
||||||
|
|
||||||
const StoragePtr & table() const override { return it->second; }
|
const StoragePtr & table() const override { return it->second; }
|
||||||
|
|
||||||
|
void reset() override { it->second.reset(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Copies list of dictionaries and iterates through such snapshot.
|
/// Copies list of dictionaries and iterates through such snapshot.
|
||||||
|
@ -28,6 +28,11 @@ public:
|
|||||||
return tables.emplace_back(storage);
|
return tables.emplace_back(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset() override
|
||||||
|
{
|
||||||
|
tables.clear();
|
||||||
|
}
|
||||||
|
|
||||||
UUID uuid() const override { return nested_iterator->uuid(); }
|
UUID uuid() const override { return nested_iterator->uuid(); }
|
||||||
|
|
||||||
DatabaseMaterializeTablesIterator(DatabaseTablesIteratorPtr nested_iterator_, DatabaseMaterializeMySQL * database_)
|
DatabaseMaterializeTablesIterator(DatabaseTablesIteratorPtr nested_iterator_, DatabaseMaterializeMySQL * database_)
|
||||||
|
Loading…
Reference in New Issue
Block a user