| 75 | } |
| 76 | |
| 77 | void OutfileTarget::updateBaseFilePathIfDistributedOutput() |
| 78 | { |
| 79 | if (context->getSettingsRef().enable_distributed_output) |
| 80 | { |
| 81 | /// each worker have to use different file name if concurrent writing |
| 82 | auto file_prefix = getIPOrFQDNOrHostName() + "_" + std::to_string(context->getTCPPort()) + "_"; |
| 83 | std::replace(file_prefix.begin(), file_prefix.end(), ':', '-'); |
| 84 | |
| 85 | Poco::Path file_path(request_uri); |
| 86 | if (file_path.isFile()) |
| 87 | { |
| 88 | String directory_path = request_uri.substr(0, request_uri.find_last_of('/')); |
| 89 | converted_uri = std::filesystem::path(directory_path) / (file_prefix + file_path.getFileName()); |
| 90 | } |
| 91 | else |
| 92 | { |
| 93 | converted_uri = std::filesystem::path(request_uri) / file_prefix; |
| 94 | } |
| 95 | } |
| 96 | else |
| 97 | { |
| 98 | converted_uri = request_uri; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | OutfileTarget::OutfileTarget( |
| 103 | ContextMutablePtr context_, std::string uri_, std::string format_, std::string compression_method_str_, int compression_level_) |
nothing calls this directly
no test coverage detected