Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File size in bytes tracking with deleted files in expire snapshots #10036

Closed

Conversation

sasankpagolu
Copy link

No description provided.

@github-actions github-actions bot added the spark label Mar 24, 2024
@sasankpagolu sasankpagolu marked this pull request as draft March 24, 2024 20:13
Copy link
Member

@RussellSpitzer RussellSpitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely the right path, if you wanted to separate out bulk from single deletes I think that's also valid. Probably simpler to get the non-bulk path working first.

Note we need tests here to make sure everything is working properly but I think you have the right approach here.

this.sizeInBytes = sizeInBytes;
}
// Getter and setter for sizeInBytes
public long getSizeInBytes() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just FYI that the Iceberg project doesn't use get/set prefixes

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

Copy link
Contributor

@dramaticlly dramaticlly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @sasankpagolu for your PR

  • looks like there's some CI failure that you might want to take a look?
  • I also left some comment to see if we can avoid introduce exclusive new class, also I am wondering if this is only meant to be used in hadoop fileIO or also applicable to other fileIO as well?

*/
package org.apache.iceberg.spark.actions;

public class RichFileInfo extends FileInfo {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defining this, I am wondering if you can reuse the existing iceberg.io.FileInfo , with location, size and created timestamp.

Alternatively, I do notice existing iceberg.spark.FileInfo only have path and type tho. Maybe also worth considering add one optional size ?

*/
package org.apache.iceberg.io;

public class FileInfoSummary {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can be replaced with iceberg.io.FileInfo

Comment on lines +199 to +219
public void deleteFilesWithSummary(Iterable<FileInfoSummary> filesToDelete)
throws BulkDeletionFailureException {
AtomicInteger failureCount = new AtomicInteger(0);
AtomicLong failureFileSize = new AtomicLong(0);
Tasks.foreach(filesToDelete)
.executeWith(executorService())
.retry(DELETE_RETRY_ATTEMPTS)
.stopRetryOn(FileNotFoundException.class)
.suppressFailureWhenFinished()
.onFailure(
(f, e) -> {
LOG.error("Failure during bulk delete on file: {} ", f.location(), e);
failureCount.incrementAndGet();
failureFileSize.addAndGet(f.size());
})
.run(fileInfo -> deleteFile(fileInfo.location()));

if (failureCount.get() != 0) {
throw new BulkDeletionFailureException(failureCount.get(), failureFileSize.get());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this new method and override only in HadoopFileIO? I think we can extract the path from FileInfoSummary and use for deletion. The failureFileSize can be summed over failure path

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 19, 2024
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants