Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] duplicate IUs

Hi Ian and Susan,
There are several ways to get a unique result. One is to use "unique() or latest()" in a query. Even if you just iterate over the result, it will be guaranteed to be unique. Another is, as Ian points out, to use the toSet methods on the result. In a user interface, I would expect the IU's to be sorted. Using a TreeSet or TreeMap will have the side effect of making everything unique.

I can think of one use-case where it is actually a good thing to get duplicates, and that is if you write a repository verifier that compares equal IU's to verify that the are exactly equal (as opposed to equal with respect to ID and version which is what equal() is using).

Regards,
Thomas Hallgren


On 03/31/2010 09:09 PM, Ian Bull wrote:


I do find it odd that the behavior will be different depending on what kind of query it is. That is, duplicates within a queryable would be filtered out, but any query that involves multiple queryables would not eliminate duplicates. Is there a reason for this difference or is it simply the result of the current implementation? The inconsistency bugs me a little.

From what I can tell, it's just a result of the current implementation. In the past, I combined the results in the compound queryable, but for performance reasons we no longer do this.   Also, if we call one of the toSet methods, we would not see the duplicates.

We could trade off this performance (runtime) issue with a performance (memory) one, and track the IUs we've seen as we iterate over them. 

cheers,
ian


susan

Inactive hide details for Ian Bull ---03/31/2010 10:56:01 AM---I was fixing some bugs in my repository analysis tool and testinIan Bull ---03/31/2010 10:56:01 AM---I was fixing some bugs in my repository analysis tool and testing it against the Galileo repository. I noticed that we had dupl





To: P2 developer discussions <p2-dev@xxxxxxxxxxx>
cc:
Subject: [p2-dev] duplicate IUs


I was fixing some bugs in my repository analysis tool and testing it against the Galileo repository. I noticed that we had duplicate IUs in the repo, so I took a closer look.  Since galileo is a composite repo (pointing to SR1 and SR2), there are duplicates between these two child repos.  Currently the query mechanism (if you use the iterator) is setup to append the two sets, but not necessarily setify the results.  Thomas brought this up a while back and I didn't think much of it.  Does anyone think this will cause a problem?

cheers,
ian

--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484

http://eclipsesource.com | http://twitter.com/eclipsesource_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev

_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev




--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource
_______________________________________________ p2-dev mailing list p2-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/p2-dev


Back to the top