]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
remove left-over early encode mechanism
authorZooko O'Whielacronx <zooko@zooko.com>
Wed, 28 Mar 2007 07:06:03 +0000 (00:06 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Wed, 28 Mar 2007 07:06:03 +0000 (00:06 -0700)
src/allmydata/codec.py

index cbf9a51c40b8470b3c29744a963694ace5b2a3f2..ab15e16bd27ec4d40f6613a484c3bbf14e84f274 100644 (file)
@@ -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"