From fa34e4dd16813923e800573f32933a1bde8fb3e7 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 4 Aug 2010 00:28:14 -0700 Subject: [PATCH] fetcher.py: improve comments --- src/allmydata/immutable/downloader/fetcher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/allmydata/immutable/downloader/fetcher.py b/src/allmydata/immutable/downloader/fetcher.py index 3918f659..e30ced85 100644 --- a/src/allmydata/immutable/downloader/fetcher.py +++ b/src/allmydata/immutable/downloader/fetcher.py @@ -161,13 +161,17 @@ class SegmentFetcher: # that will trigger the ShareFinder to keep looking def _find_one(self, shares, state): - # TODO could choose fastest + # TODO could choose fastest, or avoid servers already in use for s in shares: if self._shares[s] == state: return s # can never get here, caller has assert in case of code bug def _send_new_request(self): + # TODO: this is probably O(k^2), and we're called from a range(k) + # loop, so O(k^3) + + # this first loop prefers sh0, then sh1, sh2, etc for shnum,shares in sorted(self._shnums.iteritems()): states = [self._shares[s] for s in shares] if COMPLETE in states or PENDING in states: -- 2.45.2