ClickHouse/src/Storages/MergeTree/MergeTreeReaderStream.h

52 lines
1.5 KiB
C++
Raw Normal View History

2019-01-17 14:23:12 +00:00
#include <Storages/MarkCache.h>
#include <Storages/MergeTree/MarkRange.h>
#include <Storages/MergeTree/MergeTreeData.h>
#include <Storages/MergeTree/MergeTreeRangeReader.h>
2019-06-19 10:07:56 +00:00
#include <Storages/MergeTree/MergeTreeIndexGranularityInfo.h>
2019-01-17 14:23:12 +00:00
#include <Compression/CachedCompressedReadBuffer.h>
#include <Compression/CompressedReadBufferFromFile.h>
#include <Storages/MergeTree/MergeTreeIOSettings.h>
2019-11-20 13:33:41 +00:00
#include <Storages/MergeTree/MergeTreeMarksLoader.h>
2019-01-17 14:23:12 +00:00
namespace DB
{
2019-02-06 08:24:16 +00:00
/// Class for reading a single column (or index).
2019-01-17 14:23:12 +00:00
class MergeTreeReaderStream
{
public:
MergeTreeReaderStream(
DiskPtr disk_,
const String & path_prefix_, const String & data_file_extension_, size_t marks_count_,
const MarkRanges & all_mark_ranges,
const MergeTreeReaderSettings & settings_,
MarkCache * mark_cache, UncompressedCache * uncompressed_cache,
size_t file_size, const MergeTreeIndexGranularityInfo * index_granularity_info_,
const ReadBufferFromFileBase::ProfileCallback & profile_callback, clockid_t clock_type);
2019-01-17 14:23:12 +00:00
void seekToMark(size_t index);
void seekToStart();
2019-02-06 08:17:57 +00:00
ReadBuffer * data_buffer;
2019-01-17 14:23:12 +00:00
private:
DiskPtr disk;
2019-01-17 14:23:12 +00:00
std::string path_prefix;
2019-03-18 12:02:33 +00:00
std::string data_file_extension;
2019-01-17 14:23:12 +00:00
size_t marks_count;
2019-02-06 08:17:57 +00:00
MarkCache * mark_cache;
2019-01-17 14:23:12 +00:00
bool save_marks_in_cache;
2019-06-19 10:07:56 +00:00
const MergeTreeIndexGranularityInfo * index_granularity_info;
2019-03-27 16:23:38 +00:00
2019-01-17 14:23:12 +00:00
std::unique_ptr<CachedCompressedReadBuffer> cached_buffer;
std::unique_ptr<CompressedReadBufferFromFile> non_cached_buffer;
2019-11-20 13:33:41 +00:00
MergeTreeMarksLoader marks_loader;
2019-01-17 14:23:12 +00:00
};
}