You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2014/12/23 13:20:30 UTC
svn commit: r1647562 -
/manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
Author: kwright
Date: Tue Dec 23 12:20:30 2014
New Revision: 1647562
URL: http://svn.apache.org/r1647562
Log:
Reorganize job reset thread to be sure that doc reprioritization is actually done
Modified:
manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
Modified: manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java?rev=1647562&r1=1647561&r2=1647562&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java (original)
+++ manifoldcf/branches/CONNECTORS-1119/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java Tue Dec 23 12:20:30 2014
@@ -70,6 +70,25 @@ public class JobResetThread extends Thre
ArrayList jobStops = new ArrayList();
jobManager.finishJobStops(currentTime,jobStops);
+ ArrayList jobResumes = new ArrayList();
+ jobManager.finishJobResumes(currentTime,jobResumes);
+ ArrayList jobCompletions = new ArrayList();
+ jobManager.resetJobs(currentTime,jobCompletions);
+
+ // If there were any job aborts, we must reprioritize all active documents, since we've done something
+ // not predicted by the algorithm that assigned those priorities. This is, of course, quite expensive,
+ // but it cannot be helped (at least, I cannot find a way to avoid it).
+ //
+ if (jobStops.size() > 0 || jobResumes.size() > 0)
+ {
+ Logging.threads.debug("Job reset thread reprioritizing documents...");
+
+ ManifoldCF.resetAllDocumentPriorities(threadContext,processID);
+
+ Logging.threads.debug("Job reset thread done reprioritizing documents.");
+
+ }
+
int k = 0;
while (k < jobStops.size())
{
@@ -81,8 +100,6 @@ public class JobResetThread extends Thre
doStopNotifications(desc,notificationManager,notificationPool);
}
- ArrayList jobResumes = new ArrayList();
- jobManager.finishJobResumes(currentTime,jobResumes);
k = 0;
while (k < jobResumes.size())
{
@@ -92,8 +109,6 @@ public class JobResetThread extends Thre
desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
}
- ArrayList jobCompletions = new ArrayList();
- jobManager.resetJobs(currentTime,jobCompletions);
k = 0;
while (k < jobCompletions.size())
{
@@ -105,21 +120,7 @@ public class JobResetThread extends Thre
doEndNotifications(desc,notificationManager,notificationPool);
}
- // If there were any job aborts, we must reprioritize all active documents, since we've done something
- // not predicted by the algorithm that assigned those priorities. This is, of course, quite expensive,
- // but it cannot be helped (at least, I cannot find a way to avoid it).
- //
- if (jobStops.size() > 0 || jobResumes.size() > 0)
- {
- Logging.threads.debug("Job reset thread reprioritizing documents...");
-
- ManifoldCF.resetAllDocumentPriorities(threadContext,processID);
-
- Logging.threads.debug("Job reset thread done reprioritizing documents.");
-
- }
- else
- ManifoldCF.sleep(10000L);
+ ManifoldCF.sleep(10000L);
}
catch (ManifoldCFException e)
{