mutable: add comments about the tricky DeferredList structures in retrieve

This commit is contained in:
Brian Warner 2012-01-07 13:52:39 -08:00
parent d887782418
commit 341b8c5715
2 changed files with 7 additions and 2 deletions

View File

@ -1143,6 +1143,7 @@ class MutableFileVersion:
blockhashes = {} # shnum -> blockhash tree
for (shnum, original_data) in update_data.iteritems():
data = [d[1] for d in original_data if d[0] == self._version]
# data is [(blockhashes,start,end)..]
# Every data entry in our list should now be share shnum for
# a particular version of the mutable file, so all of the
@ -1150,8 +1151,9 @@ class MutableFileVersion:
datum = data[0]
assert [x for x in data if x != datum] == []
# datum is (blockhashes,start,end)
blockhashes[shnum] = datum[0]
start_segments[shnum] = datum[1]
start_segments[shnum] = datum[1] # (block,salt) bytestrings
end_segments[shnum] = datum[2]
d1 = r.decode(start_segments, self._start_segment)

View File

@ -120,7 +120,10 @@ class ServerMap:
self._bad_shares = {} # maps (server,shnum) to old checkstring
self._last_update_mode = None
self._last_update_time = 0
self.update_data = {} # (verinfo,shnum) => data
self.update_data = {} # shnum -> [(verinfo,(blockhashes,start,end)),..]
# where blockhashes is a list of bytestrings (the result of
# layout.MDMFSlotReadProxy.get_blockhashes), and start/end are both
# (block,salt) tuple-of-bytestrings from get_block_and_salt()
def copy(self):
s = ServerMap()