Author: toad
Date: 2005-11-10 18:00:39 +0000 (Thu, 10 Nov 2005)
New Revision: 7520
Modified:
trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
trunk/freenet/src/freenet/client/RetryTracker.java
Log:
Logging
Modified: trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
===================================================================
--- trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2005-11-10 17:38:28 UTC (rev 7519)
+++ trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2005-11-10 18:00:39 UTC (rev 7520)
@@ -25,7 +25,7 @@
static final int MAX_ARCHIVE_RESTARTS = 2;
static final boolean DONT_ENTER_IMPLICIT_ARCHIVES = true;
/** Number of threads used by a splitfile fetch */
- static final int SPLITFILE_THREADS = 20;
+ static final int SPLITFILE_THREADS = 5;
/** Number of retries allowed per block in a splitfile. Must be at
least 1 as
* on the first try we just check the datastore.
*/
@@ -41,8 +41,8 @@
/** If set, only check the local datastore, don't send an actual
request out.
* Don't turn this off either. */
static final boolean LOCAL_REQUESTS_ONLY = false;
- static final int SPLITFILE_INSERT_THREADS = 40;
- static final int SPLITFILE_INSERT_RETRIES = 10;
+ static final int SPLITFILE_INSERT_THREADS = 5;
+ static final int SPLITFILE_INSERT_RETRIES = 3;
public HighLevelSimpleClientImpl(SimpleLowLevelClient client,
ArchiveManager mgr, BucketFactory bf, RandomSource r) {
Modified: trunk/freenet/src/freenet/client/RetryTracker.java
===================================================================
--- trunk/freenet/src/freenet/client/RetryTracker.java 2005-11-10 17:38:28 UTC
(rev 7519)
+++ trunk/freenet/src/freenet/client/RetryTracker.java 2005-11-10 18:00:39 UTC
(rev 7520)
@@ -176,7 +176,6 @@
runningBlocks.remove(block);
Level l = makeLevel(block.getRetryCount());
if(l == null) throw new IllegalArgumentException();
- if(l.tracker != this) throw new
IllegalArgumentException("Belongs to wrong tracker");
int levelNumber = l.level;
l.remove(block);
levelNumber++;
@@ -211,10 +210,11 @@
* Otherwise if we are finished, call the callback's finish method.
*/
public synchronized void maybeStart(boolean cantCallFinished) {
+ Logger.minor(this, "succeeded: "+succeededBlocks.size()+",
target: "+targetSuccesses+
+ ", running: "+runningBlocks.size()+", levels:
"+levels.size()+", finishOnEmpty: "+finishOnEmpty);
if((succeededBlocks.size() >= targetSuccesses)
|| (runningBlocks.isEmpty() && levels.isEmpty()
&& finishOnEmpty)) {
- Logger.minor(this, "Finishing: succeeded:
"+succeededBlocks.size()+", target: "+targetSuccesses+
- ", running: "+runningBlocks.size()+",
levels: "+levels.size()+", finishOnEmpty: "+finishOnEmpty);
+ Logger.minor(this, "Finishing");
SplitfileBlock[] running = runningBlocks();
for(int i=0;i<running.length;i++) {
running[i].kill();
@@ -231,6 +231,7 @@
while(runningBlocks.size() < maxThreads) {
SplitfileBlock block = getBlock();
if(block == null) break;
+ Logger.minor(this, "Starting: "+block);
block.start();
runningBlocks.add(block);
}