slfan1989 commented on code in PR #659:
URL: https://github.com/apache/iceberg-cpp/pull/659#discussion_r3263904101
##########
src/iceberg/file_io.h:
##########
@@ -151,9 +151,27 @@ class ICEBERG_EXPORT FileIO {
///
/// \param file_location The location of the file to delete.
/// \return void if the delete succeeded, an error code if the delete failed.
- virtual Status DeleteFile(const std::string& file_location) {
+ virtual Status DeleteFile(const std::string&) {
return NotImplemented("DeleteFile not implemented");
}
+
+ /// \brief Delete files at the given locations.
+ ///
+ /// Implementations that can delete multiple files efficiently should
override this
+ /// method. The default implementation deletes files sequentially using
DeleteFile
+ /// and returns the first error encountered.
+ ///
+ /// \param file_locations The locations of the files to delete.
+ /// \return void if all deletes succeeded, an error code if any delete
failed.
+ virtual Status DeleteFiles(std::span<const std::string> file_locations) {
Review Comment:
Thanks, that makes sense. I originally planned to split this into two PRs:
first add the `FileIO::DeleteFiles` API, then update `ExpireSnapshots` to use
it.
I agree that this PR would be more useful if it also adopted the new API.
I’ll take a look at updating `ExpireSnapshots` to use `DeleteFiles` for grouped
file cleanup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]