]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
introducer: remove encoding-parameter config, for now
authorBrian Warner <warner@allmydata.com>
Wed, 13 Feb 2008 01:59:54 +0000 (18:59 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 13 Feb 2008 01:59:54 +0000 (18:59 -0700)
docs/configuration.txt
src/allmydata/introducer.py
src/allmydata/test/test_introducer.py

index 3a8b42075e2b69a407dfc9809b6489bd44364d3b..03202cc82957a0cb663938fca06401553edf1f8b 100644 (file)
@@ -127,24 +127,7 @@ centralized storage meshes to gather operational logs in a single place.
 Introducer nodes use the same 'advertised_ip_addresses' file as client
 nodes. They also use 'authorized_keys.SSHPORT'.
 
-encoding_parameters (optional): This file sets the encoding parameters that
-will be distributed to all client nodes and used when they encode files
-(unless locally overridden). It should contain three numbers, separated by
-whitespace, called "needed", "desired", and "total".
-
- "needed": this is the number of shares that will be needed to reconstruct
-           the file. Each share that is pushed to a StorageServer will be
-           the size of the original file divided by this number.
- "desired": the encoding/upload process will be happy if it can push
-            this many shares to StorageServers. If it cannot, it will
-            report failure.
- "total": this is the total number of shares that will be produced. The
-          expansion factor (i.e. the amount of space consumed on the whole
-          grid divided by the size of the file) will be total/needed. It does
-          not make a lot of sense to have "total" be much larger than the
-          maximum number of storage nodes you expect to ever have.
-
-The default value of encoding_parameters is "3 7 10".
+There are no additional configuration parameters for the introducer.
 
 
 == Introducer state ==
index 621721579be88e05dcad857fda4c0e35f7d8cffd..b1b58345b41eb67d20b74a32437ffbc8ef5d9ac9 100644 (file)
@@ -12,20 +12,13 @@ from allmydata.util import log, idlib
 class IntroducerNode(node.Node):
     PORTNUMFILE = "introducer.port"
     NODETYPE = "introducer"
-    ENCODING_PARAMETERS_FILE = "encoding_parameters"
-    DEFAULT_K, DEFAULT_DESIRED, DEFAULT_N = 3, 7, 10
 
     def __init__(self, basedir="."):
         node.Node.__init__(self, basedir)
         self.init_introducer()
 
     def init_introducer(self):
-        k, desired, n = self.DEFAULT_K, self.DEFAULT_DESIRED, self.DEFAULT_N
-        data = self.get_config("encoding_parameters")
-        if data is not None:
-            k,desired,n = data.split()
-            k = int(k); desired = int(desired); n = int(n)
-        introducerservice = IntroducerService(self.basedir, (k, desired, n))
+        introducerservice = IntroducerService(self.basedir)
         self.add_service(introducerservice)
 
         d = self.when_tub_ready()
@@ -41,12 +34,11 @@ class IntroducerService(service.MultiService, Referenceable):
     implements(RIIntroducerPublisherAndSubscriberService)
     name = "introducer"
 
-    def __init__(self, basedir=".", encoding_parameters=None):
+    def __init__(self, basedir="."):
         service.MultiService.__init__(self)
         self.introducer_url = None
         self._announcements = set()
         self._subscribers = {}
-        self._encoding_parameters = encoding_parameters
 
     def log(self, *args, **kwargs):
         if "facility" not in kwargs:
@@ -86,11 +78,6 @@ class IntroducerService(service.MultiService, Referenceable):
         d = subscriber.callRemote("announce", announcements)
         d.addErrback(log.err, facility="tahoe.introducer", level=log.UNUSUAL)
 
-        def UNKNOWN(): # TODO
-            if self._encoding_parameters is not None:
-                node.callRemote("set_encoding_parameters",
-                                self._encoding_parameters)
-
 
 
 class RemoteServiceConnector:
index f70e073996b02143c4820987f175cdc53c569a9f..65ac8719e04a24b3339eda5b4e9bc8be9cb08f5a 100644 (file)
@@ -27,28 +27,6 @@ class TestIntroducerNode(testutil.SignalMixin, unittest.TestCase):
         d = fireEventually(None)
         d.addCallback(lambda res: q.startService())
         d.addCallback(lambda res: q.when_tub_ready())
-        def _check_parameters(res):
-            i = q.getServiceNamed("introducer")
-            self.failUnlessEqual(i._encoding_parameters, (3, 7, 10))
-        d.addCallback(_check_parameters)
-        d.addCallback(lambda res: q.stopService())
-        d.addCallback(flushEventualQueue)
-        return d
-
-    def test_set_parameters(self):
-        basedir = "introducer.IntroducerNode.test_set_parameters"
-        os.mkdir(basedir)
-        f = open(os.path.join(basedir, "encoding_parameters"), "w")
-        f.write("25 75 100")
-        f.close()
-        q = IntroducerNode(basedir)
-        d = fireEventually(None)
-        d.addCallback(lambda res: q.startService())
-        d.addCallback(lambda res: q.when_tub_ready())
-        def _check_parameters(res):
-            i = q.getServiceNamed("introducer")
-            self.failUnlessEqual(i._encoding_parameters, (25, 75, 100))
-        d.addCallback(_check_parameters)
         d.addCallback(lambda res: q.stopService())
         d.addCallback(flushEventualQueue)
         return d