mutable: add comments about the tricky DeferredList structures in retrieve
authorBrian Warner <warner@lothar.com>
Sat, 7 Jan 2012 21:52:39 +0000 (13:52 -0800)
committerBrian Warner <warner@lothar.com>
Sun, 8 Jan 2012 22:12:38 +0000 (14:12 -0800)
src/allmydata/mutable/filenode.py
src/allmydata/mutable/servermap.py

index 08de545c620900d5d538116935b7e7f790be3827..74ed7f0a5a0fd23af88fe6e07151e9c88cdf721b 100644 (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)
index 4daee5c0ba8dff9ab58aa5a5c3c79345f6b67a37..10bb5b103f19cce3a06687cb71212fd6cc6a03f2 100644 (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()