Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailBurdukov committed May 20, 2024
1 parent e2b39db commit b43fd17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Disks/FakeDiskTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct FakeDiskTransaction final : public IDiskTransaction

void truncateFile(const std::string & /* src_path */, size_t /* target_size */) override
{
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Operation is not implemented");
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Operation `truncateFile` is not implemented");
}

private:
Expand Down
5 changes: 4 additions & 1 deletion src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ struct TruncateFileObjectStorageOperation final : public IDiskObjectStorageOpera
if (!metadata_storage.isFile(path))
throw Exception(ErrorCodes::LOGICAL_ERROR, "Path {} is not a file", path);

truncate_outcome = tx->truncateFile(path,size);
truncate_outcome = tx->truncateFile(path, size);
}
}

Expand All @@ -599,6 +599,9 @@ struct TruncateFileObjectStorageOperation final : public IDiskObjectStorageOpera

void finalize() override
{
if (!truncate_outcome)
return;

if (!truncate_outcome->objects_to_remove.empty())
object_storage.removeObjectsIfExist(truncate_outcome->objects_to_remove);
}
Expand Down
1 change: 0 additions & 1 deletion src/Disks/ObjectStorages/IMetadataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ class IMetadataTransaction : private boost::noncopyable
virtual TruncateFileOperationOutcomePtr truncateFile(const std::string & /* path */, size_t /* size */)
{
throwNotImplemented();
return nullptr;
}

virtual ~IMetadataTransaction() = default;
Expand Down

0 comments on commit b43fd17

Please sign in to comment.