-
Notifications
You must be signed in to change notification settings - Fork 487
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
the design of removeObjects #810
Comments
@KevinSmile thanks for your contribution. It is always better to discuss a new change before implementing it to save your time. I don't see how this could be low efficiency, iterating should be much faster than calling a web service and delete 1000 elements. Maybe it is your code which is doing something which takes time between iterations. |
@vadmeste thanks for for your replay! (There are 2 kinds of iterator in this issue.
As mentioned in #809, I believe using Guava's Iterables.partition and java8's stream to generate a batch-toDelete-subList is better than the original while-loop. see batch-size limit: However, I believe the strange usage of Iterable is the key problem here. It's a common practice that using iterator to traverse elements of a collection without exposing its underlying representation. I believe iterator should be used as kind of GET method, you should not do something hack (e.g. DELETE) during the iterating, as the original did in the
If you just call MinioClient.removeObjects() without traverse the returned iterator after your call, you will not trigger the
|
You could send this betterment PR separately
This is a design choice we made. Delete objects are unrecoverable, hence its not recommended to delete them in a background. That's the reason of this lazy eval. |
removeObjects is lazy eval clarified in #811 - closing this issue. |
as described in PR #809
MinioClient.removeObjects() is kind of strange and of low efficiency.
MinioClient.removeObjects() returns an Iterable.
This method is doing a DELETE job, but the actual delete job won't execute if you don't iterate over the returned Iterable-value.
Call MinioClient.removeObjects() alone deletes nothing, which is strange.
The text was updated successfully, but these errors were encountered: