-
Notifications
You must be signed in to change notification settings - Fork 360
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
Delete objects as part of Graveler #4205
Conversation
Optimize multiple object delete operation as part of gateway and openapi, by adding DeleteBatch operation that will perform the multiple delete as part of Graveler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress!
pkg/graveler/graveler.go
Outdated
@@ -2775,3 +2806,20 @@ func NewRepoInstanceID() string { | |||
tm := time.Now().UTC() | |||
return xid.NewWithTime(tm).String() | |||
} | |||
|
|||
// NewMapDeleteErrors map multi error holding DeleteError to a map of object key -> error | |||
func NewMapDeleteErrors(err error) map[string]error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move it to the errors.go
file?
Co-authored-by: itaiad200 <itaiad200@gmail.com>
delErr := c.Catalog.DeleteEntries(ctx, repository, branch, pathsToDelete) | ||
delErrs := graveler.NewMapDeleteErrors(delErr) | ||
for _, objectPath := range pathsToDelete { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you iterating the pathsToDelete, rather than the actual errors?
What should happen if all deletions in batch are successful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the first part of the function we verified authorization - each file that we do not have access we added an error or added to 'pathsToDelete'.
The list 'pathsToDelete' represents all the files we need to delete (errors will include why we can't delete the rest).
Part of the protocol we need to report (optional - quiet flag) which files we deleted or not.
So going over the files it is to either report a successful delete or the specific/general error why it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Optimize multiple object delete operation as part of gateway and open-api, by adding DeleteBatch operation that will perform the multiple delete as part of Graveler.
Notes:
Fix #4203