Author: toad
Date: 2008-06-18 22:10:01 +0000 (Wed, 18 Jun 2008)
New Revision: 20464
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
Set isInsertScheduler and isSSKScheduler early enough that they can be picked
up by the CRSCore/CRSNP.
Pass in max-value rather than -1 when no max priority etc.
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-06-18 22:08:38 UTC (rev 20463)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-06-18 22:10:01 UTC (rev 20464)
@@ -109,6 +109,8 @@
private String choosenPriorityScheduler;
public ClientRequestScheduler(boolean forInserts, boolean forSSKs,
RandomSource random, RequestStarter starter, Node node, NodeClientCore core,
SubConfig sc, String name, ClientContext context) {
+ this.isInsertScheduler = forInserts;
+ this.isSSKScheduler = forSSKs;
this.selectorContainer = node.db;
schedCore = ClientRequestSchedulerCore.create(node, forInserts,
forSSKs, selectorContainer, COOLDOWN_PERIOD, core.clientDatabaseExecutor, this,
context);
schedTransient = new ClientRequestSchedulerNonPersistent(this);
@@ -120,8 +122,6 @@
this.starter = starter;
this.random = random;
this.node = node;
- this.isInsertScheduler = forInserts;
- this.isSSKScheduler = forSSKs;
this.clientContext = context;
this.name = name;
@@ -348,7 +348,7 @@
else if(PRIORITY_HARD.equals(choosenPriorityScheduler))
fuzz = 0;
// schedCore juggles both
- return schedCore.removeFirst(fuzz, random, offeredKeys,
starter, schedTransient, false, (short) -1, -1, clientContext);
+ return schedCore.removeFirst(fuzz, random, offeredKeys,
starter, schedTransient, false, Short.MAX_VALUE, Short.MAX_VALUE,
clientContext);
}
public ChosenRequest getBetterNonPersistentRequest(ChosenRequest req) {
@@ -358,7 +358,7 @@
else if(PRIORITY_HARD.equals(choosenPriorityScheduler))
fuzz = 0;
if(req == null)
- return schedCore.removeFirst(fuzz, random, offeredKeys,
starter, schedTransient, true, (short) -1, -1, clientContext);
+ return schedCore.removeFirst(fuzz, random, offeredKeys,
starter, schedTransient, true, Short.MAX_VALUE, Integer.MAX_VALUE,
clientContext);
short prio = req.request.getPriorityClass();
int retryCount = req.request.getRetryCount();
return schedCore.removeFirst(fuzz, random, offeredKeys,
starter, schedTransient, true, prio, retryCount, clientContext);