Taking p2’s mirroring and file distribution capabilities to the next level…
“Taking it to the next level” is a phrase we often used amongst the Extreme Blue teams and staff at the IBM Ottawa Software Lab in 2007 and I think it is quite fitting for this post. Whenever we didn’t know what to do next, we’d just ask ourselves, “how do we take [our project] to the next level?”. Thanks, Marcellus!
Back in 2006, Philippe and I had a dream of using BitTorrent to distribute plug-ins and updates for Eclipse and I participated in the Google Summer of Code program in 2006 in an attempt to realize that. The keyword here is “attempt”, because, needless to say, since this post isn’t entitled “Taking the Update Manager’s mirroring and file distribution capabilities to the next level…”, I didn’t get that far. But last night, I rolled up my sleeves and began to hard code values all over the place in an attempt to write my own implementations of the IArtifactRepository and IMetadataRepository interfaces and concrete subclasses of ArtifactRepositoryFactory and MetadataRepositoryFactory.
That did not go well. Quite simply, there were just too many methods to implement and I just gave up after it decided to call my metadata repository’s query method.
What I ended up doing was I subclassed p2’s implementations of these interfaces and abstract classes for handling update sites. By doing this, p2’s user interface would render things properly in its tree and actually allow me to click ‘Install’ (instead of throwing thousands of RuntimeExceptions when I was trying it the other way). Then I simply just overrode getArtifacts to retrieve the artifacts via BitTorrent.
What you see above is my Azureus instance seeding and sharing some plug-in jars of Subclipse and my BitTorrent protocol implementation at work downloading away in the ‘Progress’ view. Of course, the files didn’t actually even go to the right place (I had to hard code that too), but hey, I really just wanted to familiarize myself with p2’s (non-existent) APIs and I think that hacking something like this up together in a couple of hours has certainly helped me out on that front. :)
And before you ask, while the implementation of the BitTorrent protocol is in ECF’s CVS repository, this hack is not publicly accessible and will likely remain that way for a while. More to come later if this hack ever stops being just a hack.
November 4th, 2008 at 10:43 pm
Cool, although what would really take p2 to the “next level” (other than better tooling for RCP developers) is the ability to push out partial updates (e.g. some server-side to calculate and send binary diffs and a client to merge the diffs into the local files.
November 7th, 2008 at 1:26 am
Robert: Did you file an enhancement request to p2 about that?