ClickHouse/src/Coordination/WriteBufferFromNuraftBuffer.h
2021-11-11 02:11:18 +03:00

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;
};
}