2014-04-02 07:59:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
#include <Core/Types.h>
|
2014-04-02 07:59:43 +00:00
|
|
|
|
2017-02-02 22:08:19 +00:00
|
|
|
namespace Poco { class Logger; }
|
|
|
|
|
2014-04-02 07:59:43 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-01-17 05:22:22 +00:00
|
|
|
class StorageReplicatedMergeTree;
|
2016-01-11 21:46:36 +00:00
|
|
|
|
|
|
|
|
2014-04-02 07:59:43 +00:00
|
|
|
class ReplicatedMergeTreeBlockOutputStream : public IBlockOutputStream
|
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
ReplicatedMergeTreeBlockOutputStream(StorageReplicatedMergeTree & storage_, const String & insert_id_,
|
|
|
|
size_t quorum_, size_t quorum_timeout_ms_);
|
2015-09-11 02:13:59 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void write(const Block & block) override;
|
2014-04-02 07:59:43 +00:00
|
|
|
|
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
StorageReplicatedMergeTree & storage;
|
|
|
|
String insert_id;
|
|
|
|
size_t quorum;
|
|
|
|
size_t quorum_timeout_ms;
|
|
|
|
size_t block_index = 0;
|
|
|
|
|
|
|
|
using Logger = Poco::Logger;
|
|
|
|
Logger * log;
|
2014-04-02 07:59:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|