consolidator: add progress to scan-old-directory passes
authorBrian Warner <warner@allmydata.com>
Fri, 13 Mar 2009 05:47:28 +0000 (22:47 -0700)
committerBrian Warner <warner@allmydata.com>
Fri, 13 Mar 2009 05:47:28 +0000 (22:47 -0700)
src/allmydata/scripts/consolidate.py

index 335bfeb8c6e22bd359ade2f114b2cd5c57147fdc..5dcec8a29fae39cf0aa45dd2d012a49f02ed31d3 100644 (file)
@@ -144,7 +144,8 @@ class Consolidator:
         data = self.read_directory_json(archives_dircap)
         snapshots = {}
 
-        for (childname, (childtype, childdata)) in data["children"].items():
+        children = sorted(data["children"].items())
+        for i, (childname, (childtype, childdata)) in enumerate(children):
             if childtype != "dirnode":
                 self.msg("non-dirnode %s in Archives/" % childname)
                 continue
@@ -160,6 +161,8 @@ class Consolidator:
             if is_readonly:
                 readcap = str(childdata["ro_uri"])
                 if self.must_rescan_readonly_snapshots:
+                    self.msg(" scanning old %s (%d/%d)" %
+                             (childname, i+1, len(children)))
                     self.scan_old_directory(str(childdata["ro_uri"]))
                 snapshots[timestamp][2] = childname
                 snapshots[timestamp][3] = readcap