Branch uses Transport and Storage objects

John A Meinel john at arbash-meinel.com
Mon Jul 11 20:56:14 BST 2005


I've been working on updating the internals of the Branch class, so that
it can support multiple protocols using a pfs-like abstraction layer.

It is available here:
http://bzr.arbash-meinel.com/bzr-split-storage/

So I created the Transport class which has functions for getting files,
or putting files, etc.
It has quite a few more functions than Arch's pfs, not least among them
is a "get_multi()" and other *_multi() functions. Which should allow
pipelining, as long as the calling code is aware that it wants a group
of files rather than just a single file.

In fact, my current implementation of _multi() can take a generator, and
for something like get_multi() it returns a generator. So in theory you
can pipeline and still get files one by one. It just means that a
specific child of Transport needs to implement the *_multi() correctly,
so that it can queue up some files in the pipe. and then return them as
it gets them.

I don't have http:// branches working yet, it just requires implementing
an HttpTransport class, but in theory this work should make implementing
sftp/ftp/smart server support much easier.

Right now I don't pass all tests, but I thought I would let people know
that it exists (and it does work for quite a few tests).

I would really like to get some feedback about the design. Because of
the great things that are generators, I don't think this code will
translate very well into C style code (though generators are just some
sort of callback). But it makes supporting pipelining a lot easier. And
to me, makes the code much cleaner, because you iterate over the files,
and you get pipelining behind the scenes.
It also makes it possible to do:
local.put_multi(other.get_multi(files))

Which can be pipelined on both ends.

Please give it a look over. I'm hoping to have all the tests passing soon.

Also, on top of Transport, I implemented an abstract Storage class.
Which takes a Transport in it's constructor. And Branch._check_format()
decides how to instantiate the Storage classes. This should allow us to
easily support say revfile style storage over both local and remote storage.

John
=:->

PS> You can save my bandwidth if you rsync the bzr mainline first,
potentially remove the last few revisions (with say my uncommit plugin),
and then pull my changes. The work is branched from mainline revno=907
Not a big deal, but my upload speed is only 30KBps

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050711/35b4ff29/attachment.pgp 


More information about the bazaar mailing list