2020-02-27 16:47:40 +00:00
|
|
|
#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(
|
2020-02-27 16:47:40 +00:00
|
|
|
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-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:
|
2020-02-27 16:47:40 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|