2014-04-02 07:59:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
2015-04-16 06:12:35 +00:00
|
|
|
#include <DB/DataStreams/IBlockOutputStream.h>
|
2017-02-07 15:38:57 +00:00
|
|
|
#include <DB/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:
|
2016-01-24 05:00:24 +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
|
|
|
|
2016-01-17 05:22:22 +00:00
|
|
|
void write(const Block & block) override;
|
2014-04-02 07:59:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
StorageReplicatedMergeTree & storage;
|
|
|
|
String insert_id;
|
2015-09-10 20:43:42 +00:00
|
|
|
size_t quorum;
|
2016-01-24 05:00:24 +00:00
|
|
|
size_t quorum_timeout_ms;
|
2015-04-16 06:12:35 +00:00
|
|
|
size_t block_index = 0;
|
2014-04-02 13:45:39 +00:00
|
|
|
|
2017-02-07 15:38:57 +00:00
|
|
|
using Logger = Poco::Logger;
|
2014-04-02 13:45:39 +00:00
|
|
|
Logger * log;
|
2014-04-02 07:59:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|