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 14:57:00 UTC
svn commit: r1647578 - in /manifoldcf/branches/release-2.0-branch: ./
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/
Author: kwright
Date: Tue Dec 23 13:56:59 2014
New Revision: 1647578
URL: http://svn.apache.org/r1647578
Log:
Pull up fix for CONNECTORS-1128.
Modified:
manifoldcf/branches/release-2.0-branch/ (props changed)
manifoldcf/branches/release-2.0-branch/CHANGES.txt
manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/StartupThread.java
Propchange: manifoldcf/branches/release-2.0-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 23 13:56:59 2014
@@ -119,4 +119,4 @@
/manifoldcf/branches/CONNECTORS-981:1605049-1605773
/manifoldcf/branches/CONNECTORS-989:1611600-1612101
/manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1644252,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646640,1646947
+/manifoldcf/trunk:1644252,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646640,1646947,1647574,1647577
Modified: manifoldcf/branches/release-2.0-branch/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.0-branch/CHANGES.txt?rev=1647578&r1=1647577&r2=1647578&view=diff
==============================================================================
--- manifoldcf/branches/release-2.0-branch/CHANGES.txt (original)
+++ manifoldcf/branches/release-2.0-branch/CHANGES.txt Tue Dec 23 13:56:59 2014
@@ -4,6 +4,10 @@ $Id$
======================= Release 2.0 =====================
+CONNECTORS-1128: Job shows no activity when restarting after
+abort.
+(Karl Wright)
+
CONNECTORS-1127: Fix boilerplate extraction to be compatible with
current version of boilerplate.
(Kamil Żyta, Karl Wright)
Modified: manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1647578&r1=1647577&r2=1647578&view=diff
==============================================================================
--- manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Tue Dec 23 13:56:59 2014
@@ -6398,7 +6398,6 @@ public class JobManager implements IJobM
boolean requestMinimum)
throws ManifoldCFException
{
-
// (1) If the connector has MODEL_ADD_CHANGE_DELETE, then
// we let the connector run the show; there's no purge phase, and therefore the
// documents are left in a COMPLETED state if they don't show up in the list
@@ -6415,6 +6414,7 @@ public class JobManager implements IJobM
// Always reset document schedules for those documents already pending!
jobQueue.resetPendingDocumentSchedules(jobID);
+ jobQueue.prioritizeQueuedDocuments(jobID);
// Complete connector model is told everything, so no delete phase.
if (connectorModel == IRepositoryConnector.MODEL_ADD_CHANGE_DELETE)
@@ -8120,7 +8120,7 @@ public class JobManager implements IJobM
// See CONNECTORS-290.
// We do this BEFORE updating the job state.
- clearDocPriorities(jobID);
+ noDocPriorities(jobID);
IJobDescription jobDesc = jobs.load(jobID,true);
modifiedJobs.add(jobDesc);
@@ -8136,7 +8136,7 @@ public class JobManager implements IJobM
}
}
- protected void clearDocPriorities(Long jobID)
+ protected void noDocPriorities(Long jobID)
throws ManifoldCFException
{
while (true)
@@ -8145,7 +8145,7 @@ public class JobManager implements IJobM
database.beginTransaction();
try
{
- jobQueue.clearDocPriorities(jobID);
+ jobQueue.noDocPriorities(jobID);
database.performCommit();
break;
}
Modified: manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java?rev=1647578&r1=1647577&r2=1647578&view=diff
==============================================================================
--- manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java (original)
+++ manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java Tue Dec 23 13:56:59 2014
@@ -932,8 +932,26 @@ public class JobQueue extends org.apache
noteModifications(0,1,0);
}
+ /** Mark queued documents for prioritization */
+ public void prioritizeQueuedDocuments(Long jobID)
+ throws ManifoldCFException
+ {
+ HashMap map = new HashMap();
+ map.put(needPriorityField,needPriorityToString(NEEDPRIORITY_TRUE));
+ map.put(needPriorityProcessIDField,null);
+ ArrayList list = new ArrayList();
+ String query = buildConjunctionClause(list,new ClauseDescription[]{
+ new UnitaryClause(jobIDField,jobID),
+ new MultiClause(statusField,new Object[]{
+ statusToString(STATUS_PENDING),
+ statusToString(STATUS_PENDINGPURGATORY),
+ statusToString(STATUS_HOPCOUNTREMOVED)})});
+ performUpdate(map,"WHERE "+query,list,null);
+ noteModifications(0,1,0);
+ }
+
/** Clear all document priorities for a job that is going to sleep */
- public void clearDocPriorities(Long jobID)
+ public void noDocPriorities(Long jobID)
throws ManifoldCFException
{
HashMap map = new HashMap();
Modified: manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java?rev=1647578&r1=1647577&r2=1647578&view=diff
==============================================================================
--- manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java (original)
+++ manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java Tue Dec 23 13:56:59 2014
@@ -102,7 +102,7 @@ public class JobResetThread extends Thre
// 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 */)
+ if (jobStops.size() > 0 || jobResumes.size() > 0)
{
Logging.threads.debug("Job reset thread reprioritizing documents...");
Modified: manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/StartupThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/StartupThread.java?rev=1647578&r1=1647577&r2=1647578&view=diff
==============================================================================
--- manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/StartupThread.java (original)
+++ manifoldcf/branches/release-2.0-branch/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/StartupThread.java Tue Dec 23 13:56:59 2014
@@ -139,7 +139,7 @@ public class StartupThread extends Threa
model,jobType == IJobDescription.TYPE_CONTINUOUS,lastSeedingVersion == null,
requestMinimum);
- //ManifoldCF.resetAllDocumentPriorities(threadContext,processID);
+ ManifoldCF.resetAllDocumentPriorities(threadContext,processID);
if (Logging.threads.isDebugEnabled())
Logging.threads.debug("Prepared job "+jobID.toString()+" for execution.");