ClickHouse/dbms/src/Storages/MergeTree/MergeTreeThreadBlockInputStream.h

52 lines
1.4 KiB
C++
Raw Normal View History

2015-06-24 11:03:53 +00:00
#pragma once
#include <Storages/MergeTree/MergeTreeBaseBlockInputStream.h>
2015-06-24 11:03:53 +00:00
namespace DB
{
2016-11-20 12:43:20 +00:00
class MergeTreeReadPool;
/** Used in conjunction with MergeTreeReadPool, asking it for more work to do and performing whatever reads it is asked
* to perform.
*/
class MergeTreeThreadBlockInputStream : public MergeTreeBaseBlockInputStream
2015-06-24 11:03:53 +00:00
{
public:
MergeTreeThreadBlockInputStream(
const size_t thread,
const std::shared_ptr<MergeTreeReadPool> & pool,
const size_t min_marks_to_read,
const size_t max_block_size,
size_t preferred_block_size_bytes,
size_t preferred_max_column_in_block_size_bytes,
MergeTreeData & storage,
const bool use_uncompressed_cache,
const PrewhereInfoPtr & prewhere_info,
const Settings & settings,
const Names & virt_column_names);
2015-06-24 11:03:53 +00:00
String getName() const override { return "MergeTreeThread"; }
~MergeTreeThreadBlockInputStream() override;
Block getHeader() const override;
2015-06-24 11:03:53 +00:00
protected:
/// Requests read task from MergeTreeReadPool and signals whether it got one
2017-04-05 20:34:19 +00:00
bool getNewTask() override;
2015-07-03 15:08:21 +00:00
2018-04-16 12:21:36 +00:00
private:
/// "thread" index (there are N threads and each thread is assigned index in interval [0..N-1])
size_t thread;
2015-07-03 15:08:21 +00:00
std::shared_ptr<MergeTreeReadPool> pool;
size_t min_marks_to_read;
2018-04-16 12:21:36 +00:00
2018-04-19 15:18:26 +00:00
/// Names from header. Used in order to order columns in read blocks.
2018-04-16 12:21:36 +00:00
Names ordered_names;
2015-06-24 11:03:53 +00:00
};
}