mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 03:42:48 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
34 lines
921 B
C++
34 lines
921 B
C++
#include <Storages/MergeTree/MergeTreeIndexReader.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
MergeTreeIndexReader::MergeTreeIndexReader(
|
|
MergeTreeIndexPtr index_, MergeTreeData::DataPartPtr part_, size_t marks_count_, const MarkRanges & all_mark_ranges_)
|
|
: index(index_), stream(
|
|
part_->disk,
|
|
part_->getFullRelativePath() + index->getFileName(), ".idx", marks_count_,
|
|
all_mark_ranges_,
|
|
MergeTreeReaderSettings{}, nullptr, nullptr,
|
|
part_->getFileSizeOrZero(index->getFileName() + ".idx"),
|
|
&part_->index_granularity_info,
|
|
ReadBufferFromFileBase::ProfileCallback{}, CLOCK_MONOTONIC_COARSE)
|
|
{
|
|
stream.seekToStart();
|
|
}
|
|
|
|
void MergeTreeIndexReader::seek(size_t mark)
|
|
{
|
|
stream.seekToMark(mark);
|
|
}
|
|
|
|
MergeTreeIndexGranulePtr MergeTreeIndexReader::read()
|
|
{
|
|
auto granule = index->createIndexGranule();
|
|
granule->deserializeBinary(*stream.data_buffer);
|
|
return granule;
|
|
}
|
|
|
|
}
|