Author: toad
Date: 2009-02-14 01:33:09 +0000 (Sat, 14 Feb 2009)
New Revision: 25639
Modified:
branches/db4o/freenet/src/freenet/client/FECCodec.java
branches/db4o/freenet/src/freenet/client/FECQueue.java
branches/db4o/freenet/src/freenet/client/StandardOnionFECCodec.java
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
Log:
Don't need executor for the codec
Modified: branches/db4o/freenet/src/freenet/client/FECCodec.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECCodec.java 2009-02-14
01:30:13 UTC (rev 25638)
+++ branches/db4o/freenet/src/freenet/client/FECCodec.java 2009-02-14
01:33:09 UTC (rev 25639)
@@ -47,13 +47,13 @@
* Get a codec where we know both the number of data blocks and the
number
* of check blocks, and the codec type. Normally for decoding.
*/
- public static FECCodec getCodec(short splitfileType, int dataBlocks,
int checkBlocks, Executor executor) {
+ public static FECCodec getCodec(short splitfileType, int dataBlocks,
int checkBlocks) {
if(Logger.shouldLog(Logger.MINOR, FECCodec.class))
Logger.minor(FECCodec.class, "getCodec:
splitfileType="+splitfileType+" dataBlocks="+dataBlocks+"
checkBlocks="+checkBlocks);
if(splitfileType == Metadata.SPLITFILE_NONREDUNDANT)
return null;
if(splitfileType == Metadata.SPLITFILE_ONION_STANDARD)
- return StandardOnionFECCodec.getInstance(dataBlocks,
checkBlocks, executor);
+ return StandardOnionFECCodec.getInstance(dataBlocks,
checkBlocks);
else
return null;
}
@@ -62,12 +62,12 @@
* Get a codec where we know only the number of data blocks and the
codec
* type. Normally for encoding.
*/
- public static FECCodec getCodec(short splitfileType, int dataBlocks,
Executor executor) {
+ public static FECCodec getCodec(short splitfileType, int dataBlocks) {
if(splitfileType == Metadata.SPLITFILE_NONREDUNDANT)
return null;
if(splitfileType == Metadata.SPLITFILE_ONION_STANDARD) {
int checkBlocks = standardOnionCheckBlocks(dataBlocks);
- return StandardOnionFECCodec.getInstance(dataBlocks,
checkBlocks, executor);
+ return StandardOnionFECCodec.getInstance(dataBlocks,
checkBlocks);
}
else
return null;
Modified: branches/db4o/freenet/src/freenet/client/FECQueue.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECQueue.java 2009-02-14
01:30:13 UTC (rev 25638)
+++ branches/db4o/freenet/src/freenet/client/FECQueue.java 2009-02-14
01:33:09 UTC (rev 25639)
@@ -174,10 +174,10 @@
// Encode it
try {
if (job.isADecodingJob)
-
job.getCodec(executor).realDecode(job.dataBlockStatus, job.checkBlockStatus,
job.blockLength,
+
job.getCodec().realDecode(job.dataBlockStatus, job.checkBlockStatus,
job.blockLength,
job.bucketFactory);
else {
-
job.getCodec(executor).realEncode(job.dataBlocks, job.checkBlocks,
job.blockLength, job.bucketFactory);
+
job.getCodec().realEncode(job.dataBlocks, job.checkBlocks, job.blockLength,
job.bucketFactory);
// Update
SplitFileBlocks from buckets if necessary
if
((job.dataBlockStatus != null) || (job.checkBlockStatus != null)) {
for (int i = 0;
i < job.dataBlocks.length; i++)
Modified: branches/db4o/freenet/src/freenet/client/StandardOnionFECCodec.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/StandardOnionFECCodec.java
2009-02-14 01:30:13 UTC (rev 25638)
+++ branches/db4o/freenet/src/freenet/client/StandardOnionFECCodec.java
2009-02-14 01:33:09 UTC (rev 25639)
@@ -47,7 +47,7 @@
}
}
- public synchronized static FECCodec getInstance(int dataBlocks, int
checkBlocks, Executor executor) {
+ public synchronized static FECCodec getInstance(int dataBlocks, int
checkBlocks) {
MyKey key = new MyKey(dataBlocks, checkBlocks + dataBlocks);
StandardOnionFECCodec codec = (StandardOnionFECCodec)
recentlyUsedCodecs.get(key);
if(codec != null) {
Modified:
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2009-02-14 01:30:13 UTC (rev 25638)
+++ branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2009-02-14 01:33:09 UTC (rev 25639)
@@ -437,7 +437,7 @@
}
}
if(codec == null)
- codec = FECCodec.getCodec(splitfileType,
dataKeys.length, checkKeys.length, context.mainExecutor);
+ codec = FECCodec.getCodec(splitfileType,
dataKeys.length, checkKeys.length);
FECJob job = new FECJob(codec, queue, dataBuckets,
checkBuckets, CHKBlock.DATA_LENGTH, context.getBucketFactory(persistent), this,
true, parent.getPriorityClass(), persistent);
codec.addToQueue(job,
queue, container);
@@ -459,7 +459,7 @@
container.activate(context, 1);
}
if(codec == null)
- codec = FECCodec.getCodec(splitfileType,
dataKeys.length, checkKeys.length, context.mainExecutor);
+ codec = FECCodec.getCodec(splitfileType,
dataKeys.length, checkKeys.length);
// Because we use SplitfileBlock, we DON'T have to copy here.
// See FECCallback comments for explanation.
try {
Modified:
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
2009-02-14 01:30:13 UTC (rev 25638)
+++
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
2009-02-14 01:33:09 UTC (rev 25639)
@@ -287,7 +287,7 @@
Logger.normal(this, "Not encoded because no check
blocks");
encoded = false;
FECCodec splitfileAlgo =
FECCodec.getCodec(splitfileAlgorithm,
- dataBlockCount, context.mainExecutor);
+ dataBlockCount);
int checkBlocksCount =splitfileAlgo.countCheckBlocks();
this.checkURIs = new ClientCHK[checkBlocksCount];
this.checkBlocks = new Bucket[checkBlocksCount];
@@ -405,7 +405,7 @@
Logger.minor(this, "Segment " + segNo + " of "
+ parent + " ("
+ parent.dataLength + ") is not
encoded");
splitfileAlgo = FECCodec.getCodec(this.splitfileAlgo,
- dataBlocks.length, checkBlocks.length,
context.mainExecutor);
+ dataBlocks.length, checkBlocks.length);
if (logMINOR)
Logger.minor(this, "Encoding segment "
+ segNo + " of "
+ parent + " (" +
parent.dataLength + ") persistent="+persistent);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs