Author: toad
Date: 2008-06-14 11:24:45 +0000 (Sat, 14 Jun 2008)
New Revision: 20334

Modified:
   branches/db4o/freenet/src/freenet/client/FetchContext.java
   branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
   branches/db4o/freenet/src/freenet/node/NodeClientCore.java
Log:
Eliminate slowSerialExecutor[] (one per priority, used for limiting I/O on 
starting requests) - not needed now that we have a dedicated thread for 
checking the store when starting requests.

Modified: branches/db4o/freenet/src/freenet/client/FetchContext.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FetchContext.java  2008-06-14 
11:21:06 UTC (rev 20333)
+++ branches/db4o/freenet/src/freenet/client/FetchContext.java  2008-06-14 
11:24:45 UTC (rev 20334)
@@ -47,7 +47,6 @@
        /** If set, contains a set of blocks to be consulted before checking 
the datastore. */
        public BlockSet blocks;
        public Set allowedMIMETypes;
-       public final Executor[] slowSerialExecutor;

        public FetchContext(long curMaxLength, 
                        long curMaxTempLength, int maxMetadataSize, int 
maxRecursionLevel, int maxArchiveRestarts, int maxArchiveLevels,
@@ -57,9 +56,7 @@
                        int maxDataBlocksPerSegment, int 
maxCheckBlocksPerSegment,
                        BucketFactory bucketFactory,
                        ClientEventProducer producer, boolean 
cacheLocalRequests, USKManager uskManager, 
-                       boolean ignoreTooManyPathComponents,  
-                       Executor[] slowSerialExecutor) {
-               this.slowSerialExecutor = slowSerialExecutor;
+                       boolean ignoreTooManyPathComponents) {
                this.maxOutputLength = curMaxLength;
                this.uskManager = uskManager;
                this.maxTempLength = curMaxTempLength;
@@ -87,7 +84,6 @@
                        this.eventProducer = ctx.eventProducer;
                else
                        this.eventProducer = new SimpleEventProducer();
-               this.slowSerialExecutor = ctx.slowSerialExecutor;
                this.uskManager = ctx.uskManager;
                this.ignoreTooManyPathComponents = 
ctx.ignoreTooManyPathComponents;
                this.blocks = ctx.blocks;

Modified: 
branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java     
2008-06-14 11:21:06 UTC (rev 20333)
+++ branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java     
2008-06-14 11:24:45 UTC (rev 20334)
@@ -45,7 +45,6 @@
        private long curMaxTempLength;
        private int curMaxMetadataLength;
        private final RandomSource random;
-       private final Executor slowSerialExecutor[];
        /** See comments in Node */
        private final boolean cacheLocalRequests;
        static final int MAX_RECURSION = 10;
@@ -80,9 +79,8 @@
        static final int SPLITFILE_CHECK_BLOCKS_PER_SEGMENT = 128;


-       public HighLevelSimpleClientImpl(NodeClientCore node, BucketFactory bf, 
RandomSource r, boolean cacheLocalRequests, short priorityClass, boolean 
forceDontIgnoreTooManyPathComponents, Executor[] slowSerialExecutor) {
+       public HighLevelSimpleClientImpl(NodeClientCore node, BucketFactory bf, 
RandomSource r, boolean cacheLocalRequests, short priorityClass, boolean 
forceDontIgnoreTooManyPathComponents) {
                this.core = node;
-               this.slowSerialExecutor = slowSerialExecutor;
                this.priorityClass = priorityClass;
                bucketFactory = bf;
                this.persistentFileTracker = node.persistentTempBucketFactory;
@@ -190,7 +188,7 @@
                                FETCH_SPLITFILES, FOLLOW_REDIRECTS, 
LOCAL_REQUESTS_ONLY,
                                MAX_SPLITFILE_BLOCKS_PER_SEGMENT, 
MAX_SPLITFILE_CHECK_BLOCKS_PER_SEGMENT,
                                bucketFactory, globalEventProducer, 
-                               cacheLocalRequests, core.uskManager, false, 
slowSerialExecutor);
+                               cacheLocalRequests, core.uskManager, false);
        }

        public InsertContext getInsertContext(boolean forceNonPersistent) {

Modified: branches/db4o/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2008-06-14 
11:21:06 UTC (rev 20333)
+++ branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2008-06-14 
11:24:45 UTC (rev 20334)
@@ -112,7 +112,6 @@
        /** If true, requests are resumed lazily i.e. startup does not block 
waiting for them. */
        private boolean lazyResume;
        protected final Persister persister;
-       private final SerialExecutor clientSlowSerialExecutor[];
        /** All client-layer database access occurs on a SerialExecutor, so 
that we don't need
         * to have multiple parallel transactions. Advantages:
         * - We never have two copies of the same object in RAM, and more 
broadly, we don't
@@ -148,14 +147,6 @@
                this.random = node.random;
                fecQueue = new FECQueue();
                this.backgroundBlockEncoder = new BackgroundBlockEncoder();
-               clientSlowSerialExecutor = new 
SerialExecutor[RequestStarter.MINIMUM_PRIORITY_CLASS-RequestStarter.MAXIMUM_PRIORITY_CLASS+1];
-               for(int i=0;i<clientSlowSerialExecutor.length;i++) {
-                       int prio;
-                       if(i <= 
RequestStarter.IMMEDIATE_SPLITFILE_PRIORITY_CLASS) prio = 
NativeThread.NORM_PRIORITY;
-                       else if(i <= RequestStarter.UPDATE_PRIORITY_CLASS) prio 
= NativeThread.LOW_PRIORITY;
-                       else prio = NativeThread.MIN_PRIORITY;
-                       clientSlowSerialExecutor[i] = new SerialExecutor(prio);
-               }
                clientDatabaseExecutor = new 
PrioritizedSerialExecutor(NativeThread.NORM_PRIORITY, 
NativeThread.MAX_PRIORITY+1, NativeThread.NORM_PRIORITY);
                datastoreCheckerExecutor = new 
PrioritizedSerialExecutor(NativeThread.NORM_PRIORITY, 
RequestStarter.NUMBER_OF_PRIORITY_CLASSES, 0);
                byte[] pwdBuf = new byte[16];
@@ -309,7 +300,7 @@
                healingQueue = new 
SimpleHealingQueue(requestStarters.chkPutScheduler,
                                new InsertContext(tempBucketFactory, 
tempBucketFactory, persistentTempBucketFactory, 
                                                0, 2, 1, 0, 0, new 
SimpleEventProducer(), 
-                                               
!Node.DONT_CACHE_LOCAL_REQUESTS, uskManager, node.executor), 
RequestStarter.PREFETCH_PRIORITY_CLASS, 512 /* FIXME make configurable */);
+                                               
!Node.DONT_CACHE_LOCAL_REQUESTS, uskManager), 
RequestStarter.PREFETCH_PRIORITY_CLASS, 512 /* FIXME make configurable */);

                nodeConfig.register("lazyResume", false, sortOrder++, true, 
false, "NodeClientCore.lazyResume",
                                "NodeClientCore.lazyResumeLong", new 
BooleanCallback() {
@@ -436,8 +427,6 @@
                        fcpServer.maybeStart();
                if(tmci != null)
                        tmci.start();
-               for(int i=0;i<clientSlowSerialExecutor.length;i++)
-                       clientSlowSerialExecutor[i].start(node.executor, "Heavy 
client jobs runner ("+i+")");

                node.executor.execute(new PrioRunnable() {
                        public void run() {
@@ -1023,7 +1012,7 @@
        }

        public HighLevelSimpleClient makeClient(short prioClass, boolean 
forceDontIgnoreTooManyPathComponents) {
-               return new HighLevelSimpleClientImpl(this, tempBucketFactory, 
random, !Node.DONT_CACHE_LOCAL_REQUESTS, prioClass, 
forceDontIgnoreTooManyPathComponents, clientSlowSerialExecutor);
+               return new HighLevelSimpleClientImpl(this, tempBucketFactory, 
random, !Node.DONT_CACHE_LOCAL_REQUESTS, prioClass, 
forceDontIgnoreTooManyPathComponents);
        }

        public FCPServer getFCPServer() {


Reply via email to