mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
31 lines
558 B
C++
31 lines
558 B
C++
#pragma once
|
|
|
|
#include <IO/WriteBuffer.h>
|
|
#include <libnuraft/nuraft.hxx>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class WriteBufferFromNuraftBuffer : public WriteBuffer
|
|
{
|
|
public:
|
|
WriteBufferFromNuraftBuffer();
|
|
|
|
nuraft::ptr<nuraft::buffer> getBuffer();
|
|
bool isFinished() const { return finalized; }
|
|
|
|
~WriteBufferFromNuraftBuffer() override;
|
|
|
|
private:
|
|
void finalizeImpl() override final;
|
|
|
|
void nextImpl() override;
|
|
|
|
nuraft::ptr<nuraft::buffer> buffer;
|
|
|
|
static constexpr size_t initial_size = 32;
|
|
static constexpr size_t size_multiplier = 2;
|
|
};
|
|
|
|
}
|