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

Method copyFile

src/Disks/IDisk.cpp:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void IDisk::copyFile( /// NOLINT
64 const String & from_file_path,
65 IDisk & to_disk,
66 const String & to_file_path,
67 const ReadSettings & read_settings,
68 const WriteSettings & write_settings,
69 const std::function<void()> & cancellation_hook
70 )
71{
72 LOG_DEBUG(getLogger("IDisk"), "Copying from {} (path: {}) {} to {} (path: {}) {}.",
73 getName(), getPath(), from_file_path, to_disk.getName(), to_disk.getPath(), to_file_path);
74
75 auto in = readFile(from_file_path, read_settings);
76 auto out = to_disk.writeFile(to_file_path, DBMS_DEFAULT_BUFFER_SIZE, WriteMode::Rewrite, write_settings);
77 copyData(*in, *out, cancellation_hook);
78 out->finalize();
79}
80
81std::unique_ptr<ReadBufferFromFileBase> IDisk::readFile(
82 const String & path,

Callers 6

executeImplMethod · 0.45
BackupImplFunction · 0.45
copyFileFromMethod · 0.45
moveFileBetweenDisksFunction · 0.45
save_stateMethod · 0.45
asyncCopyFunction · 0.45

Calls 9

copyDataFunction · 0.85
getLoggerFunction · 0.50
getNameFunction · 0.50
getPathFunction · 0.50
readFileFunction · 0.50
getNameMethod · 0.45
getPathMethod · 0.45
writeFileMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected