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