Author: toad
Date: 2009-02-02 23:38:56 +0000 (Mon, 02 Feb 2009)
New Revision: 25480
Modified:
branches/db4o/freenet/src/freenet/support/io/PersistentBlobTempBucketFactory.java
Log:
Fix nasty shrinking bug.
Logging.
Modified:
branches/db4o/freenet/src/freenet/support/io/PersistentBlobTempBucketFactory.java
===================================================================
---
branches/db4o/freenet/src/freenet/support/io/PersistentBlobTempBucketFactory.java
2009-02-02 23:03:47 UTC (rev 25479)
+++
branches/db4o/freenet/src/freenet/support/io/PersistentBlobTempBucketFactory.java
2009-02-02 23:38:56 UTC (rev 25480)
@@ -405,13 +405,14 @@
continue;
} else {
lastCommitted = tags.next().index;
- Logger.normal(this, "No used slots in
persistent temp file (but last not committed = "+lastNotCommitted+")");
+ Logger.normal(this, "Last committed
block is "+lastCommitted);
break;
}
}
if(lastCommitted == -1) {
// No used slots at all?!
// There may be some not committed though
+ Logger.normal(this, "No used slots in
persistent temp file (but last not committed = "+lastNotCommitted+")");
lastCommitted = 0;
}
full = (double) lastCommitted / (double) blocks;
@@ -423,7 +424,7 @@
}
long lastBlock = Math.max(lastCommitted,
lastNotCommitted);
// Must be 10% free at end
- newBlocks = (long) ((lastBlock + 32) * (1.0 / 1.1));
+ newBlocks = (long) ((lastBlock + 32) * 1.1);
newBlocks = Math.max(newBlocks, 32);
System.err.println("Shrinking blob file from "+blocks+"
to "+newBlocks);
for(long l = newBlocks; l <= blocks; l++) {
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs