2020-10-10 18:37:02 +00:00
|
|
|
#pragma once
|
2022-04-12 18:59:49 +00:00
|
|
|
#include <Storages/MergeTree/IDataPartStorage.h>
|
2019-11-20 13:33:41 +00:00
|
|
|
#include <Storages/MarkCache.h>
|
2022-07-18 12:09:57 +00:00
|
|
|
#include <IO/ReadSettings.h>
|
2019-11-20 13:33:41 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-02-03 12:46:25 +00:00
|
|
|
struct MergeTreeIndexGranularityInfo;
|
|
|
|
|
2019-11-20 13:33:41 +00:00
|
|
|
class MergeTreeMarksLoader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using MarksPtr = MarkCache::MappedPtr;
|
|
|
|
|
2020-02-03 12:46:25 +00:00
|
|
|
MergeTreeMarksLoader(
|
2022-04-12 18:59:49 +00:00
|
|
|
DataPartStoragePtr data_part_storage_,
|
2020-02-03 12:46:25 +00:00
|
|
|
MarkCache * mark_cache_,
|
|
|
|
const String & mrk_path,
|
|
|
|
size_t marks_count_,
|
|
|
|
const MergeTreeIndexGranularityInfo & index_granularity_info_,
|
2019-11-20 13:33:41 +00:00
|
|
|
bool save_marks_in_cache_,
|
2022-07-18 12:09:57 +00:00
|
|
|
const ReadSettings & read_settings_,
|
2020-03-09 02:26:50 +00:00
|
|
|
size_t columns_in_mark_ = 1);
|
2019-12-18 16:41:11 +00:00
|
|
|
|
2019-11-20 13:33:41 +00:00
|
|
|
const MarkInCompressedFile & getMark(size_t row_index, size_t column_index = 0);
|
|
|
|
|
|
|
|
bool initialized() const { return marks != nullptr; }
|
|
|
|
|
|
|
|
private:
|
2022-04-12 18:59:49 +00:00
|
|
|
DataPartStoragePtr data_part_storage;
|
2019-11-20 13:33:41 +00:00
|
|
|
MarkCache * mark_cache = nullptr;
|
|
|
|
String mrk_path;
|
2020-02-03 12:46:25 +00:00
|
|
|
size_t marks_count;
|
|
|
|
const MergeTreeIndexGranularityInfo & index_granularity_info;
|
2019-11-20 13:33:41 +00:00
|
|
|
bool save_marks_in_cache = false;
|
2020-02-03 16:37:00 +00:00
|
|
|
size_t columns_in_mark;
|
2020-02-03 12:46:25 +00:00
|
|
|
MarkCache::MappedPtr marks;
|
2022-07-18 12:09:57 +00:00
|
|
|
ReadSettings read_settings;
|
2019-11-20 13:33:41 +00:00
|
|
|
|
|
|
|
void loadMarks();
|
2020-02-03 12:46:25 +00:00
|
|
|
MarkCache::MappedPtr loadMarksImpl();
|
2019-11-20 13:33:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|