ClickHouse/src/Storages/MergeTree/MergeTreeMarksLoader.h

43 lines
986 B
C++
Raw Normal View History

2020-10-10 18:37:02 +00:00
#pragma once
#include <Disks/IDisk.h>
2019-11-20 13:33:41 +00:00
#include <Storages/MarkCache.h>
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(
DiskPtr disk_,
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_,
2020-03-09 02:26:50 +00:00
size_t columns_in_mark_ = 1);
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:
DiskPtr disk;
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;
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
};
}