-from twisted.internet import defer
-from twisted.python import failure
from foolscap import DeadReferenceError
-from allmydata import hashtree, storage
+from allmydata import hashtree
from allmydata.checker_results import CheckerResults
from allmydata.immutable import download
from allmydata.uri import CHKFileVerifierURI
from allmydata.util.assertutil import precondition
-from allmydata.util import base32, deferredutil, hashutil, log, nummedobj, rrefutil
+from allmydata.util import base32, deferredutil, log, rrefutil
from allmydata.immutable import layout
-def _permute_servers(servers, key):
- return sorted(servers, key=lambda x: sha.new(key+x[0]).digest())
-
class Checker(log.PrefixingLogMixin):
""" I query all servers to see if M uniquely-numbered shares are available.
from allmydata.interfaces import IFileNode, IFileURI, ICheckable, \
IDownloadTarget
from allmydata.util import log, base32
-from allmydata.uri import from_string as uri_from_string
from allmydata.immutable.checker import Checker
from allmydata.checker_results import CheckAndRepairResults
from allmydata.immutable.repairer import Repairer
from twisted.internet import defer
-from twisted.python import failure
from allmydata import storage
from allmydata.checker_results import CheckerResults, CheckAndRepairResults
from allmydata.immutable import download
-from allmydata.util import base32, hashutil, log, nummedobj
+from allmydata.util import nummedobj
from allmydata.util.assertutil import precondition
from allmydata.uri import CHKFileVerifierURI
from allmydata.immutable import layout
-import sha
+import sha, time
def _permute_servers(servers, key):
return sorted(servers, key=lambda x: sha.new(key+x[0]).digest())
self._results.timings["peer_selection"] = now - self._started
if len(self._share_buckets) < self._num_needed_shares:
- raise NotEnoughSharesError
+ raise download.NotEnoughSharesError
def _verify_done(self, ignored):
# TODO: The following results are just stubs, and need to be replaced