rearrange encode/upload, add URIs, switch to ReplicatingEncoder

Added metadata to the bucket store, which is used to hold the share number
(but the bucket doesn't know that, it just gets a string).

Modified the codec interfaces a bit.

Try to pass around URIs to/from download/upload instead of verifierids.
URI format is still in flux.

Change the current (primitive) file encoder to use a ReplicatingEncoder
because it provides ICodecEncoder. We will be moving to the (less primitive)
file encoder (currently in allmydata.encode_new) eventually, but for now
this change lets us test out PyRS or zooko's upcoming C-based RS codec in
something larger than a single unit test. This primitive file encoder only
uses a single segment, and has no merkle trees.

Also added allmydata.util.deferredutil for a DeferredList wrapper that
errbacks (but only when all component Deferreds have fired) if there were
any errors, which unfortunately is not a behavior available from the standard
DeferredList.
This commit is contained in:
Brian Warner
2007-01-15 21:22:22 -07:00
parent 78a9e815c5
commit 3209fd5e09
15 changed files with 392 additions and 103 deletions

View File

@ -140,6 +140,7 @@ class Client(node.Node, Referenceable):
# sort of at most max_count elements
results = []
for nodeid in self.all_peers:
assert isinstance(nodeid, str)
permuted = sha.new(key + nodeid).digest()
results.append((permuted, nodeid))
results.sort()