ClickHouse/src/Storages/MergeTree/IMergeTreeReadPool.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.0 KiB
C++
Raw Normal View History

2023-02-14 14:14:11 +00:00
#pragma once
#include <boost/noncopyable.hpp>
#include <Core/Block.h>
#include <IO/ReadBufferFromFileBase.h>
#include <Storages/MergeTree/MergeTreeReadTask.h>
2023-02-14 14:14:11 +00:00
namespace DB
{
/// The interface that determines how tasks for reading (MergeTreeReadTask)
/// are distributed among data parts with ranges.
2023-02-14 14:14:11 +00:00
class IMergeTreeReadPool : private boost::noncopyable
{
public:
virtual ~IMergeTreeReadPool() = default;
virtual String getName() const = 0;
2023-02-14 14:14:11 +00:00
virtual Block getHeader() const = 0;
/// Returns true if tasks are returned in the same order as the order of ranges passed to pool
virtual bool preservesOrderOfRanges() const = 0;
2023-02-14 14:14:11 +00:00
/// task_idx is an implentation defined identifier that helps
/// to get required task. E.g. it may be number of thread, index of
virtual MergeTreeReadTaskPtr getTask(size_t task_idx, MergeTreeReadTask * previous_task) = 0;
2023-02-14 14:14:11 +00:00
virtual void profileFeedback(ReadBufferFromFileBase::ProfileInfo info) = 0;
};
using MergeTreeReadPoolPtr = std::shared_ptr<IMergeTreeReadPool>;
}