Author: mrogers
Date: 2006-10-31 14:44:44 +0000 (Tue, 31 Oct 2006)
New Revision: 10754
Modified:
trunk/apps/load-balancing-sims/phase7/sim/generators/SimplePublisher.java
Log:
Wait longer before requesting keys... still hangs
Modified:
trunk/apps/load-balancing-sims/phase7/sim/generators/SimplePublisher.java
===================================================================
--- trunk/apps/load-balancing-sims/phase7/sim/generators/SimplePublisher.java
2006-10-31 14:33:19 UTC (rev 10753)
+++ trunk/apps/load-balancing-sims/phase7/sim/generators/SimplePublisher.java
2006-10-31 14:44:44 UTC (rev 10754)
@@ -1,5 +1,5 @@
// A simple publisher that inserts CHKs using a Poisson process and informs
-// each reader of each key after an average of one minute
+// each reader of each key after an average of ten minutes
package sim.generators;
import sim.Event;
@@ -20,7 +20,7 @@
readers = new HashSet<Node>();
// Schedule the first insert
double delay = -Math.log (Math.random()) / rate;
- Event.schedule (this, delay, INSERT_CHK, null);
+ Event.schedule (this, delay, PUBLISH, null);
}
public boolean addReader (Node n)
@@ -30,27 +30,27 @@
// Event callbacks
- private void insertChk()
+ private void publish()
{
// Insert a random key
int key = Node.locationToKey (Math.random());
Event.schedule (node, 0.0, Node.INSERT_CHK, key);
- // Inform each reader after an average of one minute
+ // Inform each reader after an average of ten minutes
for (Node n : readers) {
- double delay = -Math.log (Math.random()) * 60.0;
+ double delay = -Math.log (Math.random()) * 600.0;
Event.schedule (n, delay, Node.REQUEST_CHK, key);
}
// Schedule the next insert
double delay = -Math.log (Math.random()) / rate;
- Event.schedule (this, delay, INSERT_CHK, null);
+ Event.schedule (this, delay, PUBLISH, null);
}
// EventTarget interface
public void handleEvent (int type, Object data)
{
- if (type == INSERT_CHK) insertChk();
+ if (type == PUBLISH) publish();
}
- private final static int INSERT_CHK = 1;
+ private final static int PUBLISH = 1;
}