2023-02-14 14:14:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
#include <Core/Block.h>
|
|
|
|
#include <IO/ReadBufferFromFileBase.h>
|
2023-08-29 13:38:51 +00:00
|
|
|
#include <Storages/MergeTree/MergeTreeReadTask.h>
|
2023-02-14 14:14:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2023-08-29 13:38:51 +00:00
|
|
|
/// 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;
|
2023-08-29 13:38:51 +00:00
|
|
|
virtual String getName() const = 0;
|
2023-02-14 14:14:11 +00:00
|
|
|
virtual Block getHeader() const = 0;
|
|
|
|
|
2023-08-29 13:38:51 +00:00
|
|
|
/// 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
|
|
|
|
2023-08-29 13:38:51 +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>;
|
|
|
|
|
|
|
|
}
|