MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / readFile

Method readFile

src/Storages/MergeTree/IMergeTreeDataPart.cpp:3159–3171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3157}
3158
3159std::unique_ptr<ReadBuffer> IMergeTreeDataPart::readFile(const String & file_name) const
3160{
3161 constexpr size_t size_hint = 4096; /// These files are small.
3162 auto read_settings = getReadSettings().adjustBufferSize(size_hint);
3163 /// Default read method is pread_threadpool, but there is not much point in it here.
3164 read_settings.local_fs_settings.method = LocalFSReadMethod::pread;
3165 auto res = getDataPartStorage().readFile(file_name, read_settings, size_hint);
3166
3167 if (isCompressedFromFileName(file_name))
3168 return std::make_unique<CompressedReadBufferFromFile>(std::move(res));
3169
3170 return res;
3171}
3172
3173std::unique_ptr<ReadBuffer> IMergeTreeDataPart::readFileIfExists(const String & file_name) const
3174{

Callers 15

restoreDataImplMethod · 0.45
startMethod · 0.45
loadIndicesMethod · 0.45
restoreDataImplMethod · 0.45
nextMethod · 0.45
generateMethod · 0.45
StreamMethod · 0.45
loadMarksMethod · 0.45
restoreDataImplMethod · 0.45
restoreFromFileMethod · 0.45
advanceToNextPartMethod · 0.45

Calls 3

getReadSettingsFunction · 0.85
isCompressedFromFileNameFunction · 0.85
adjustBufferSizeMethod · 0.80

Tested by

no test coverage detected