diff --git a/src/allmydata/immutable/download.py b/src/allmydata/immutable/download.py
index eb02c6a..39256d9 100644
a
|
b
|
class SegmentDownloader: |
636 | 636 | return self._download() |
637 | 637 | |
638 | 638 | def _download(self): |
| 639 | started = time.time() |
| 640 | print "bug1170 SegmentDownloader[%d] started %f" % (self.segmentnumber, |
| 641 | started) |
639 | 642 | d = self._try() |
640 | 643 | def _done(res): |
641 | 644 | if len(self.blocks) >= self.needed_blocks: |
… |
… |
class SegmentDownloader: |
646 | 649 | blocks = [] |
647 | 650 | for blocknum in blockids: |
648 | 651 | blocks.append(self.blocks[blocknum]) |
| 652 | print "bug1170 SegmentDownloader[%d] done, elapsed=%f" % (self.segmentnumber, time.time()-started) |
649 | 653 | return (blocks, blockids) |
650 | 654 | else: |
651 | 655 | return self._download() |
… |
… |
class CiphertextDownloader(log.PrefixingLogMixin): |
844 | 848 | |
845 | 849 | def start(self): |
846 | 850 | self.log("starting download") |
| 851 | print "bug1170: start download", time.time() |
847 | 852 | |
848 | 853 | # first step: who should we download from? |
849 | 854 | d = defer.maybeDeferred(self._get_all_shareholders) |
… |
… |
class CiphertextDownloader(log.PrefixingLogMixin): |
935 | 940 | self._status.set_status("Locating Shares (%d/%d)" % |
936 | 941 | (self._responses_received, |
937 | 942 | self._total_queries)) |
| 943 | #if not idlib.shortnodeid_b2a(peerid).startswith("p7wc"): |
| 944 | # return |
938 | 945 | for sharenum, bucket in buckets.iteritems(): |
939 | 946 | b = layout.ReadBucketProxy(bucket, peerid, self._storage_index) |
940 | 947 | self.add_share_bucket(sharenum, b) |
… |
… |
class CiphertextDownloader(log.PrefixingLogMixin): |
979 | 986 | del self._share_vbuckets[shnum] |
980 | 987 | |
981 | 988 | def _got_all_shareholders(self, res): |
| 989 | print "bug1170: _got_all_shareholders", time.time() |
982 | 990 | if self._results: |
983 | 991 | now = time.time() |
984 | 992 | self._results.timings["peer_selection"] = now - self._started |
… |
… |
class CiphertextDownloader(log.PrefixingLogMixin): |
1044 | 1052 | return d |
1045 | 1053 | |
1046 | 1054 | def _get_crypttext_hash_tree(self, res): |
| 1055 | print "bug1170: _get_crypttext_hash_tree", time.time() |
1047 | 1056 | vchtps = [] |
1048 | 1057 | for sharenum, buckets in self._share_buckets.iteritems(): |
1049 | 1058 | for bucket in buckets: |
1050 | 1059 | vchtp = ValidatedCrypttextHashTreeProxy(bucket, self._crypttext_hash_tree, self._vup.num_segments, self._fetch_failures) |
1051 | 1060 | vchtps.append(vchtp) |
| 1061 | bs = ",".join([idlib.shortnodeid_b2a(vchtp._readbucketproxy._peerid) |
| 1062 | for vchtp in vchtps]) |
| 1063 | print " bug1170: from", bs |
1052 | 1064 | |
1053 | 1065 | _get_crypttext_hash_tree_started = time.time() |
1054 | 1066 | if self._status: |
… |
… |
class CiphertextDownloader(log.PrefixingLogMixin): |
1095 | 1107 | # and a random bucket that will provide it |
1096 | 1108 | validated_bucket = random.choice(list(self._share_vbuckets[shnum])) |
1097 | 1109 | self.active_buckets[shnum] = validated_bucket |
| 1110 | bs = ",".join(["sh%d-on-%s" % (shnum, idlib.shortnodeid_b2a(self.active_buckets[shnum].bucket._peerid)) |
| 1111 | for shnum in self.active_buckets]) |
| 1112 | print "bug1170: buckets:", bs |
1098 | 1113 | return self.active_buckets |
1099 | 1114 | |
1100 | 1115 | |
1101 | 1116 | def _download_all_segments(self, res): |
| 1117 | print "bug1170: _download_all_segments", time.time() |
1102 | 1118 | # From now on if new buckets are received then I will notice that |
1103 | 1119 | # self._share_vbuckets is not None and generate a vbucket for that new |
1104 | 1120 | # bucket and add it in to _share_vbuckets. (We had to wait because we |