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

Method StorageFile

src/Storages/StorageFile.cpp:1180–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180StorageFile::StorageFile(int table_fd_, CommonArguments args)
1181 : StorageFile(args)
1182{
1183 struct stat buf{};
1184 int res = fstat(table_fd_, &buf);
1185 if (-1 == res)
1186 throw ErrnoException(ErrorCodes::CANNOT_FSTAT, "Cannot execute fstat");
1187 total_bytes_to_read = buf.st_size;
1188
1189 if (args.getContext()->getApplicationType() == Context::ApplicationType::SERVER)
1190 throw Exception(ErrorCodes::DATABASE_ACCESS_DENIED, "Using file descriptor as source of storage isn't allowed for server daemons");
1191 if (args.format_name == "Distributed")
1192 throw Exception(ErrorCodes::INCORRECT_FILE_NAME, "Distributed format is allowed only with explicit file path");
1193
1194 is_db_table = false;
1195 use_table_fd = true;
1196 table_fd = table_fd_;
1197 setStorageMetadata(args);
1198}
1199
1200StorageFile::StorageFile(FileSource file_source_, CommonArguments args)
1201 : StorageFile(args)

Callers

nothing calls this directly

Calls 10

ErrnoExceptionClass · 0.85
FileRenamerClass · 0.85
getTablePathFunction · 0.85
getApplicationTypeMethod · 0.80
checkFormatNameMethod · 0.80
ExceptionClass · 0.50
getNameFunction · 0.50
getContextMethod · 0.45
emptyMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected