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

Method readFile

src/IO/PackedFilesReader.cpp:85–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85std::unique_ptr<ReadBufferFromFileBase> PackedFilesReader::readFile(
86 const DiskPtr & disk,
87 const String & data_file_name,
88 const String & file_name,
89 const ReadSettings & settings,
90 std::optional<size_t> read_hint) const
91{
92 auto it = index.find(file_name);
93 if (it == index.end())
94 throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "File {} does not exist", file_name);
95
96 const auto & [offset, size] = it->second;
97
98 /// ReadBufferFromFileView doesn't support reading with mmap and direct io methods, because
99 /// they require special alignment which cannot be achieved while reading archive file.
100 /// So just disable them.
101 auto in = disk->readFile(data_file_name, patchSettings(settings), read_hint);
102 return std::make_unique<ReadBufferFromFileView>(std::move(in), file_name, offset, offset + size);
103}
104
105}

Callers 8

PackedFilesReaderMethod · 0.45
validateModuleFileFunction · 0.45
loadModuleImplMethod · 0.45
readMethod · 0.45
readMetadataUnlockedMethod · 0.45
removeTmpMetadataFileMethod · 0.45

Calls 4

patchSettingsFunction · 0.85
ExceptionClass · 0.70
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected