提交 ee89dfc9 编写于 作者: A Azat Khuzhin

Implement totalBytes() for StorageBuffer

上级 bc32865e
......@@ -744,6 +744,17 @@ std::optional<UInt64> StorageBuffer::totalRows() const
return rows + *underlying_rows;
}
std::optional<UInt64> StorageBuffer::totalBytes() const
{
UInt64 bytes = 0;
for (auto & buffer : buffers)
{
std::lock_guard lock(buffer.mutex);
bytes += buffer.data.bytes();
}
return bytes;
}
void StorageBuffer::alter(const AlterCommands & params, const Context & context, TableStructureWriteLockHolder & table_lock_holder)
{
lockStructureExclusively(table_lock_holder, context.getCurrentQueryId());
......
......@@ -92,6 +92,7 @@ public:
void alter(const AlterCommands & params, const Context & context, TableStructureWriteLockHolder & table_lock_holder) override;
std::optional<UInt64> totalRows() const override;
std::optional<UInt64> totalBytes() const override;
~StorageBuffer() override;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册