From: Daira Hopwood Date: Thu, 5 Sep 2013 18:03:18 +0000 (+0100) Subject: Sun Jan 8 22:12:38 GMT 2012 Brian Warner X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/vdrive?a=commitdiff_plain;h=adb13f76601fdc327866455f07e46b50dc9d4dfa;p=tahoe-lafs%2Ftahoe-lafs.git Sun Jan 8 22:12:38 GMT 2012 Brian Warner * mutable: add comments about the tricky DeferredList structures in retrieve --- diff --git a/src/allmydata/mutable/filenode.py b/src/allmydata/mutable/filenode.py index 30278db3..d11b6403 100644 --- a/src/allmydata/mutable/filenode.py +++ b/src/allmydata/mutable/filenode.py @@ -1144,6 +1144,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 @@ -1151,8 +1152,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) diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py index eafb16c4..130250b2 100644 --- a/src/allmydata/mutable/servermap.py +++ b/src/allmydata/mutable/servermap.py @@ -119,7 +119,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()