Add FileLocationSource::FromBinlog.
GitOrigin-RevId: cedd828bbd79a8cfc04efa0ecb239dafbfed4eab
This commit is contained in:
parent
24128120cb
commit
71aa152460
@ -50,6 +50,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, FileLocationSource sour
|
|||||||
return string_builder << "None";
|
return string_builder << "None";
|
||||||
case FileLocationSource::FromUser:
|
case FileLocationSource::FromUser:
|
||||||
return string_builder << "User";
|
return string_builder << "User";
|
||||||
|
case FileLocationSource::FromBinlog:
|
||||||
|
return string_builder << "Binlog";
|
||||||
case FileLocationSource::FromDatabase:
|
case FileLocationSource::FromDatabase:
|
||||||
return string_builder << "Database";
|
return string_builder << "Database";
|
||||||
case FileLocationSource::FromServer:
|
case FileLocationSource::FromServer:
|
||||||
@ -966,7 +968,8 @@ Result<FileId> FileManager::register_file(FileData &&data, FileLocationSource fi
|
|||||||
bool has_remote = data.remote_.type() == RemoteFileLocation::Type::Full;
|
bool has_remote = data.remote_.type() == RemoteFileLocation::Type::Full;
|
||||||
bool has_generate = data.generate_ != nullptr;
|
bool has_generate = data.generate_ != nullptr;
|
||||||
if (data.local_.type() == LocalFileLocation::Type::Full && !force) {
|
if (data.local_.type() == LocalFileLocation::Type::Full && !force) {
|
||||||
if (file_location_source == FileLocationSource::FromDatabase) {
|
if (file_location_source == FileLocationSource::FromBinlog ||
|
||||||
|
file_location_source == FileLocationSource::FromDatabase) {
|
||||||
PathView path_view(data.local_.full().path_);
|
PathView path_view(data.local_.full().path_);
|
||||||
if (path_view.is_relative()) {
|
if (path_view.is_relative()) {
|
||||||
data.local_.full().path_ = PSTRING()
|
data.local_.full().path_ = PSTRING()
|
||||||
|
@ -46,7 +46,7 @@ extern int VERBOSITY_NAME(update_file);
|
|||||||
class FileData;
|
class FileData;
|
||||||
class FileDbInterface;
|
class FileDbInterface;
|
||||||
|
|
||||||
enum class FileLocationSource : int8 { None, FromUser, FromDatabase, FromServer };
|
enum class FileLocationSource : int8 { None, FromUser, FromBinlog, FromDatabase, FromServer };
|
||||||
|
|
||||||
struct NewRemoteFileLocation {
|
struct NewRemoteFileLocation {
|
||||||
NewRemoteFileLocation() = default;
|
NewRemoteFileLocation() = default;
|
||||||
|
@ -155,7 +155,7 @@ FileId FileManager::parse_file(ParserT &parser) {
|
|||||||
if (parser.version() >= static_cast<int32>(Version::StoreFileOwnerId)) {
|
if (parser.version() >= static_cast<int32>(Version::StoreFileOwnerId)) {
|
||||||
parse(owner_dialog_id, parser);
|
parse(owner_dialog_id, parser);
|
||||||
}
|
}
|
||||||
return register_remote(full_remote_location, FileLocationSource::FromDatabase, owner_dialog_id, size,
|
return register_remote(full_remote_location, FileLocationSource::FromBinlog, owner_dialog_id, size,
|
||||||
expected_size, name);
|
expected_size, name);
|
||||||
}
|
}
|
||||||
case FileStoreType::Local: {
|
case FileStoreType::Local: {
|
||||||
@ -200,7 +200,7 @@ FileId FileManager::parse_file(ParserT &parser) {
|
|||||||
full_generated_location.conversion_ = PSTRING() << "#file_id#" << download_file_id.get();
|
full_generated_location.conversion_ = PSTRING() << "#file_id#" << download_file_id.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r_file_id = register_generate(full_generated_location.file_type_, FileLocationSource::FromDatabase,
|
auto r_file_id = register_generate(full_generated_location.file_type_, FileLocationSource::FromBinlog,
|
||||||
full_generated_location.original_path_, full_generated_location.conversion_,
|
full_generated_location.original_path_, full_generated_location.conversion_,
|
||||||
owner_dialog_id, expected_size);
|
owner_dialog_id, expected_size);
|
||||||
if (r_file_id.is_ok()) {
|
if (r_file_id.is_ok()) {
|
||||||
@ -217,7 +217,7 @@ FileId FileManager::parse_file(ParserT &parser) {
|
|||||||
if (parser.version() >= static_cast<int32>(Version::StoreFileOwnerId)) {
|
if (parser.version() >= static_cast<int32>(Version::StoreFileOwnerId)) {
|
||||||
parse(owner_dialog_id, parser);
|
parse(owner_dialog_id, parser);
|
||||||
}
|
}
|
||||||
return register_url(url, type, FileLocationSource::FromDatabase, owner_dialog_id);
|
return register_url(url, type, FileLocationSource::FromBinlog, owner_dialog_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FileId();
|
return FileId();
|
||||||
|
Reference in New Issue
Block a user