From: Zooko O'Whielacronx Date: Wed, 28 Mar 2007 07:06:03 +0000 (-0700) Subject: remove left-over early encode mechanism X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=0a9a6f0216d6e69722a2c1deb86d00c26423cdc5;p=tahoe-lafs%2Ftahoe-lafs.git remove left-over early encode mechanism --- diff --git a/src/allmydata/codec.py b/src/allmydata/codec.py index cbf9a51c..ab15e16b 100644 --- a/src/allmydata/codec.py +++ b/src/allmydata/codec.py @@ -75,50 +75,6 @@ class ReplicatingDecoder(object): return defer.succeed(l) -class Encoder(object): - def __init__(self, infile, m): - self.infile = infile - self.k = 2 - self.m = m - - def do_upload(self, landlords): - dl = [] - data = self.infile.read() - for (peerid, bucket_num, remotebucket) in landlords: - dl.append(remotebucket.callRemote('write', data)) - dl.append(remotebucket.callRemote('close')) - - return defer.DeferredList(dl) - -class Decoder(object): - def __init__(self, outfile, k, m, verifierid): - self.outfile = outfile - self.k = k - self.m = m - self._verifierid = verifierid - - def start(self, buckets): - assert len(buckets) >= self.k - dl = [] - for bucketnum, bucket in buckets[:self.k]: - d = bucket.callRemote("read") - dl.append(d) - d2 = defer.DeferredList(dl) - d2.addCallback(self._got_all_data) - return d2 - - def _got_all_data(self, resultslist): - shares = [results for success,results in resultslist if success] - assert len(shares) >= self.k - # here's where the Reed-Solomon magic takes place - self.outfile.write(shares[0]) - hasher = sha.new(netstring("allmydata_v1_verifierid")) - hasher.update(shares[0]) - vid = hasher.digest() - if self._verifierid: - assert self._verifierid == vid, "%s != %s" % (idlib.b2a(self._verifierid), idlib.b2a(vid)) - - class CRSEncoder(object): implements(ICodecEncoder) ENCODER_TYPE = "crs"