Community
Participate
Working Groups
for performance reasons we have bulk add operations on metadata and artifact repos. We also have a bulk remove on metadata repos. There is no such operation (other than removeAll) on artifact repos. This would be very handy in the RepositroyListener for example.
Created attachment 117357 [details] Added removeDescriptors(IArtifactDescriptors[]) for SimpleArtifactRepository The actual implementation is logically identical to that of addDescriptors(IArtifactDescriptors[]) except with "add" replaced by "remove" I also included a test case I ran on it to verify it works properly. Because it's a variation on addDescriptors, implementing a removeDescriptors shouldn't be too hard if we decide to promote this to API.
Could you please work with Simon and/or John on that. Thx.
*** Bug 238669 has been marked as a duplicate of this bug. ***
I'm upgrading this and targetting it. I just ran a performance test that uses dropins where we end up removing 4000 artifacts from a simple artifact repo and the time taken was over 7 minutes. In 3.4 we used a technique where we re-created the artifact repos after doing removal in an in memory list this resulted in one write instead of "n" writes. That approach is no longer easy to do as the publishing now occurs deeper down in the publisher however we need to find a good alternative.
*** Bug 184538 has been marked as a duplicate of this bug. ***
Ian, you may want to take a look at that in the context of bug #274025.
bug #274025 will provide a solution to this. Do we still want an explicit remove(IArtifactDescriptor[] desc) method?
(In reply to comment #7) > bug #274025 will provide a solution to this. Do we still want an explicit > remove(IArtifactDescriptor[] desc) method? The remove case seems much easier because we can delete both the artifact and the index entry in the same call. I think it would be useful to have such a method and fairly simple to implement.
Created attachment 176923 [details] patch Here is a patch against the R36_maintenance branch which adds new API to IArtifactRepository. John, can you verify that I've done the right thing with the version numbers here? I want to make sure we don't run into problems with people requiring bundles and version ranges, etc. This is what I've done: - incremented the minor version of p2.repository since we added API (2.0 -> 2.1) - incremented the service version of the bundles of all the implementors of the new API - changed the requires range for p2.engine from [2.0, 2.1) to [2.0, 2.2)
I quickly went through the code and it looks good, but I wonder if we want to introduce a new API in a point release.
I'm inclined to think the same way. There were a couple of bugs blocked by this but they have been worked around in 3.6. I'm going to bump this to 3.7.
(In reply to comment #9) > John, can you verify that I've done the right thing with the version numbers > here? I want to make sure we don't run into problems with people requiring > bundles and version ranges, etc. Looks good to me. I also agree on bumping to 3.7 since there is new API here.
Created attachment 177524 [details] patch
Patch released to HEAD. Closing.
There was a problem with tagging HEAD so this fix won't appear in integration builds until the first build after 3.7 M2.