[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] making p2 metadata serializable

On 2011-01-23, at 9:35 AM, Igor Fedorenko wrote:

> Tycho is expected to detect and discard incompatible cached target
> platform, so automatic class version validation performed during java
> deserialization is actually desired behaviour.
> 
> Tycho build target platform is a mixture or p2 and tycho objects and
> java de/serialization seems like a convenient standard mechanism. I
> realise it is not hard (albeit tedious) to write Tycho specific
> de/serializable logic for p2 metadata but I am concerned about
> maintenance of this code. When a new field is added to p2 metadata,
> we'll have to somehow learn about it and update our custom
> de/serializable logic accordingly. Unfortunately, most likely we won't
> know about the new field until somebody runs into very hard to diagnose
> cache misbehaviour.
	ATM, my concern around marking the API classes serializable is how do we communicate the fact that we will not support backward compatibility, etc.
	At this point, I'm not convinced that the benefit wroth you get the hassle we'll get :)
	Given that you have a bunch of IU objects, you could simply create a new repository at the location of your liking, dump all the IUs in it, and reload that at a later point when you are short-circuiting resolution.


> 
> --
> Regards,
> Igor
> 
> On 11-01-22 11:53 PM, Ian Bull wrote:
>> Hi Igor,
>> 
>> We talked about this last year, and the problem with serialization is
>> the constraints placed on the format with respect to API.  Once we
>> declare the p2 metadata serializable, it would seem that you could read
>> / write the data without worry. However, if a new field is added to the
>> metadata, this assumption will break.
>> 
>> FWIW, a while ago I experimented with my own class structure that
>> mirrored the metadata (for each class associated with the p2 metadata,
>> there is a corresponding interface -- so this isn't too hard). I maked
>> these as serializable and used this format.  While it was better /
>> faster / smaller than the compressed XML, the results weren't that
>> impressive.
>> 
>> HTH,
>> Ian
>> 
>> On Fri, Jan 21, 2011 at 8:57 PM, Igor Fedorenko <ifedorenko@xxxxxxxxxxxx
>> <mailto:ifedorenko@xxxxxxxxxxxx>> wrote:
>> 
>>    Tycho calculates and maintains build target platform for each project
>>    individually. For larger builds, with tens or even hundreds of projects,
>>    target platform resolution becomes quite time consuming so I am looking
>>    for ways to optimise this. One optimisation I am considering is caching
>>    resolved target platform instances between re-builds of the same project
>>    and I was hoping to use serialization as an easy way to implement this.
>> 
>>    p2 metadata is part of target platform state Tycho needs to maintain and
>>    unfortunately p2 metadata is not serializable.
>> 
>>    So as the subject says, is there a chance p2 metadata will become
>>    serializable in 3.7 or I should look for alternative solutions?
>> 
>>    --
>>    Regards,
>>    Igor
>>    _______________________________________________
>>    p2-dev mailing list
>>    p2-dev@xxxxxxxxxxx <mailto: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
> _______________________________________________
> p2-dev mailing list
> p2-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/p2-dev