[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Renaming and testing



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv28866/lib/mixminion/server

Modified Files:
	ServerConfig.py ServerMain.py ServerQueue.py 
Log Message:
Renaming and testing

- Rename client pools to client queues.
- Rename mix queues to mix pools.

  (Now, we call something a "pool" iff we rely on it to batch and
   re-order messages.  "Queue" is still kind of a misnomer, since our
   "queues" aren't FIFO but rather FI-don't-care-O.)

- Test and debug client keyrings



Index: ServerConfig.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerConfig.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ServerConfig.py	26 Mar 2003 16:36:46 -0000	1.19
+++ ServerConfig.py	27 Mar 2003 10:31:00 -0000	1.20
@@ -68,7 +68,7 @@
         mixInterval = server['MixInterval'][2]
         if mixInterval < 30*60:
             LOG.warn("Dangerously low MixInterval")
-        if server['MixAlgorithm'] == 'TimedMixQueue':
+        if server['MixAlgorithm'] == 'TimedMixPool':
             if _haveEntry(entries, 'Server', 'MixPoolRate'):
                 LOG.warn("Option MixPoolRate is not used for Timed mixing.")
             if _haveEntry(entries, 'Server', 'MixPoolMinSize'):
@@ -148,13 +148,13 @@
 #======================================================================
 
 _MIX_RULE_NAMES = {
-    'timed' : "TimedMixQueue",
-    'cottrell'     : "CottrellMixQueue",
-    'mixmaster'    : "CottrellMixQueue",
-    'dynamicpool'  : "CottrellMixQueue",
-    'binomial'            : "BinomialCottrellMixQueue",
-    'binomialcottrell'    : "BinomialCottrellMixQueue",
-    'binomialdynamicpool' : "BinomialCottrellMixQueue",
+    'timed' : "TimedMixPool",
+    'cottrell'     : "CottrellMixPool",
+    'mixmaster'    : "CottrellMixPool",
+    'dynamicpool'  : "CottrellMixPool",
+    'binomial'            : "BinomialCottrellMixPool",
+    'binomialcottrell'    : "BinomialCottrellMixPool",
+    'binomialdynamicpool' : "BinomialCottrellMixPool",
 }
 
 def _parseMixRule(s):

Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- ServerMain.py	26 Mar 2003 16:36:46 -0000	1.45
+++ ServerMain.py	27 Mar 2003 10:31:00 -0000	1.46
@@ -110,14 +110,14 @@
             self.removeMessage(handle) # ???? Really dump this message?
 
 class MixPool:
-    """Wraps a mixminion.server.Queue.*MixQueue to send messages to an exit
-       queue and a delivery queue.  The files in the MixQueue are instances
+    """Wraps a mixminion.server.Queue.*MixPool to send messages to an exit
+       queue and a delivery queue.  The files in the MixPool are instances
        of RelayedPacket or DeliveryPacket from PacketHandler.
 
        All methods on this class are invoked from the main thread.
     """
     ## Fields:
-    # queue -- underlying *MixQueue
+    # queue -- underlying *MixPool
     # outgoingQueue -- instance of OutgoingQueue
     # moduleManager -- instance of ModuleManager.
     def __init__(self, config, queueDir):
@@ -126,39 +126,39 @@
 
         server = config['Server']
         interval = server['MixInterval'][2]
-        if server['MixAlgorithm'] == 'TimedMixQueue':
-            self.queue = mixminion.server.ServerQueue.TimedMixQueue(
+        if server['MixAlgorithm'] == 'TimedMixPool':
+            self.queue = mixminion.server.ServerQueue.TimedMixPool(
                 location=queueDir, interval=interval)
-        elif server['MixAlgorithm'] == 'CottrellMixQueue':
-            self.queue = mixminion.server.ServerQueue.CottrellMixQueue(
+        elif server['MixAlgorithm'] == 'CottrellMixPool':
+            self.queue = mixminion.server.ServerQueue.CottrellMixPool(
                 location=queueDir, interval=interval,
                 minPool=server.get("MixPoolMinSize", 5),
                 sendRate=server.get("MixPoolRate", 0.6))
-        elif server['MixAlgorithm'] == 'BinomialCottrellMixQueue':
-            self.queue = mixminion.server.ServerQueue.BinomialCottrellMixQueue(
+        elif server['MixAlgorithm'] == 'BinomialCottrellMixPool':
+            self.queue = mixminion.server.ServerQueue.BinomialCottrellMixPool(
                 location=queueDir, interval=interval,
                 minPool=server.get("MixPoolMinSize", 5),
                 sendRate=server.get("MixPoolRate", 0.6))
         else:
-            raise MixFatalError("Got impossible mix queue type from config")
+            raise MixFatalError("Got impossible mix pool type from config")
 
-        self.outgoingQueue = None
+        self.outgoingPool = None
         self.moduleManager = None
 
     def lock(self):
-        """Acquire the lock on the underlying queue"""
+        """Acquire the lock on the underlying pool"""
         self.queue.lock()
 
     def unlock(self):
-        """Release the lock on the underlying queue"""
+        """Release the lock on the underlying pool"""
         self.queue.unlock()
 
     def queueObject(self, obj):
-        """Insert an object into the queue."""
+        """Insert an object into the pool."""
         self.queue.queueObject(obj)
 
     def count(self):
-        "Return the number of messages in the queue"
+        "Return the number of messages in the pool"
         return self.queue.count()
 
     def connectQueues(self, outgoing, manager):

Index: ServerQueue.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerQueue.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ServerQueue.py	26 Mar 2003 17:02:09 -0000	1.11
+++ ServerQueue.py	27 Mar 2003 10:31:00 -0000	1.12
@@ -17,8 +17,8 @@
      createPrivateDir
 from mixminion.Crypto import getCommonPRNG
 
-__all__ = [ 'Queue', 'DeliveryQueue', 'TimedMixQueue', 'CottrellMixQueue',
-            'BinomialCottrellMixQueue' ]
+__all__ = [ 'Queue', 'DeliveryQueue', 'TimedMixPool', 'CottrellMixPool',
+            'BinomialCottrellMixPool' ]
 
 # Mode to pass to open(2) for creating a new file, and dying if it already
 # exists.
@@ -492,14 +492,14 @@
         finally:
             self._lock.release()
 
-class TimedMixQueue(Queue):
-    """A TimedMixQueue holds a group of files, and returns some of them
+class TimedMixPool(Queue):
+    """A TimedMixPool holds a group of files, and returns some of them
        as requested, according to a mixing algorithm that sends a batch
        of messages every N seconds."""
     ## Fields:
     #   interval: scanning interval, in seconds.
     def __init__(self, location, interval=600):
-        """Create a TimedMixQueue that sends its entire batch of messages
+        """Create a TimedMixPool that sends its entire batch of messages
            every 'interval' seconds."""
         Queue.__init__(self, location, create=1, scrub=1)
         self.interval = interval
@@ -512,8 +512,8 @@
     def getInterval(self):
         return self.interval
 
-class CottrellMixQueue(TimedMixQueue):
-    """A CottrellMixQueue holds a group of files, and returns some of them
+class CottrellMixPool(TimedMixPool):
+    """A CottrellMixPool holds a group of files, and returns some of them
        as requested, according the Cottrell (timed dynamic-pool) mixing
        algorithm from Mixmaster."""
     ## Fields:
@@ -545,7 +545,7 @@
         # *THIS* is the algorithm that the current 'Batching Taxonomy' paper
         # says that Cottrell says is the real thing.
 
-        TimedMixQueue.__init__(self, location, interval)
+        TimedMixPool.__init__(self, location, interval)
         self.minPool = minPool
         self.minSend = minSend
         self.sendRate = sendRate
@@ -568,7 +568,7 @@
             return []
 
 class _BinomialMixin:
-    """Mixin class.  Given a MixQueue that defines a _getBatchSize function,
+    """Mixin class.  Given a MixPool that defines a _getBatchSize function,
        replaces the getBatch function with one that -- instead of sending N
        messages from a pool of size P, sends each message with probability
        N/P."""
@@ -582,7 +582,7 @@
         return rng.shuffle([ h for h in self.getAllMessages()
                              if rng.getFloat() < msgProbability ])
 
-class BinomialCottrellMixQueue(_BinomialMixin,CottrellMixQueue):
-    """Same algorithm as CottrellMixQueue, but instead of sending N messages
+class BinomialCottrellMixPool(_BinomialMixin,CottrellMixPool):
+    """Same algorithm as CottrellMixPool, but instead of sending N messages
        from the pool of size P, sends each message with probability N/P."""