incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1205397 - in /incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler: interfaces/IJobManager.java jobs/JobManager.java jobs/Jobs.java system/JobResetThread.java
Date Wed, 23 Nov 2011 13:51:24 GMT
Author: kwright
Date: Wed Nov 23 13:51:23 2011
New Revision: 1205397

URL: http://svn.apache.org/viewvc?rev=1205397&view=rev
Log:
Hook up transition from pausing/activewaiting/aborting to the terminal state, and also the
subsequent reprioritization of documents.

Modified:
    incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
    incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
    incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
    incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java

Modified: incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java?rev=1205397&r1=1205396&r2=1205397&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
(original)
+++ incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
Wed Nov 23 13:51:23 2011
@@ -826,11 +826,13 @@ public interface IJobManager
   public boolean errorAbort(Long jobID, String errorText)
     throws ManifoldCFException;
 
-  /** Complete the sequence that aborts jobs and makes them runnable again.
+  /** Complete the sequence that stops jobs, either for abort, pause, or because of a scheduling
+  * window.  The logic will move the job to its next state (INACTIVE, PAUSED, ACTIVEWAIT),
+  * and will record the jobs that have been so modified.
   *@param timestamp is the current time in milliseconds since epoch.
-  *@param abortJobs is filled in with the set of IJobDescription objects that were aborted.
+  *@param modifiedJobs is filled in with the set of IJobDescription objects that were stopped.
   */
-  public void finishJobAborts(long timestamp, ArrayList abortJobs)
+  public void finishJobStops(long timestamp, ArrayList modifiedJobs)
     throws ManifoldCFException;
 
   /** Put all eligible jobs in the "shutting down" state.

Modified: incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1205397&r1=1205396&r2=1205397&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Wed Nov 23 13:51:23 2011
@@ -6205,117 +6205,77 @@ public class JobManager implements IJobM
     }
   }
   
-  /** Complete the sequence that aborts jobs and makes them runnable again.
-  *@param timestamp is the current time.
-  *@param abortJobs is the set of IJobDescription objects that were aborted (and stopped).
+  /** Complete the sequence that stops jobs, either for abort, pause, or because of a scheduling
+  * window.  The logic will move the job to its next state (INACTIVE, PAUSED, ACTIVEWAIT),
+  * and will record the jobs that have been so modified.
+  *@param timestamp is the current time in milliseconds since epoch.
+  *@param modifiedJobs is filled in with the set of IJobDescription objects that were stopped.
   */
-  public void finishJobAborts(long timestamp, ArrayList abortJobs)
+  public void finishJobStops(long timestamp, ArrayList modifiedJobs)
     throws ManifoldCFException
   {
-    while (true)
-    {
-      long sleepAmt = 0L;
-      database.beginTransaction();
-      try
-      {
-        // The query I used to emit was:
-        // SELECT jobid FROM jobs t0 WHERE t0.status='X' AND NOT EXISTS(SELECT 'x' FROM jobqueue
t1 WHERE
-        //              t0.id=t1.jobid AND t1.status IN ('A','F'))
-        // Now the query is broken up so that Postgresql behaves more efficiently.
-
-        // Do the first query, getting the candidate jobs to be considered
-        StringBuilder sb = new StringBuilder("SELECT ");
-        ArrayList list = new ArrayList();
+    // The query I used to emit was:
+    // SELECT jobid FROM jobs t0 WHERE t0.status='X' AND NOT EXISTS(SELECT 'x' FROM jobqueue
t1 WHERE
+    //              t0.id=t1.jobid AND t1.status IN ('A','F'))
+    // Now the query is broken up so that Postgresql behaves more efficiently.
+
+    // Do the first query, getting the candidate jobs to be considered
+    StringBuilder sb = new StringBuilder("SELECT ");
+    ArrayList list = new ArrayList();
         
-        sb.append(jobs.idField).append(",")
-          .append(jobs.statusField)
-          .append(" FROM ").append(jobs.getTableName()).append(" WHERE ")
-          .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-            new MultiClause(jobs.statusField,new Object[]{
-              jobs.statusToString(jobs.STATUS_ABORTING),
-              jobs.statusToString(jobs.STATUS_ABORTINGFORRESTART)})}))
-          .append(" FOR UPDATE");
+    sb.append(jobs.idField)
+      .append(" FROM ").append(jobs.getTableName()).append(" WHERE ")
+      .append(database.buildConjunctionClause(list,new ClauseDescription[]{
+        new MultiClause(jobs.statusField,new Object[]{
+          jobs.statusToString(jobs.STATUS_ABORTING),
+          jobs.statusToString(jobs.STATUS_ABORTINGFORRESTART),
+          jobs.statusToString(jobs.STATUS_PAUSING),
+          jobs.statusToString(jobs.STATUS_PAUSINGSEEDING),
+          jobs.statusToString(jobs.STATUS_ACTIVEWAITING),
+          jobs.statusToString(jobs.STATUS_ACTIVEWAITINGSEEDING),
+          jobs.statusToString(jobs.STATUS_PAUSINGWAITING),
+          jobs.statusToString(jobs.STATUS_PAUSINGWAITINGSEEDING)
+          })}));
         
-        IResultSet set = database.performQuery(sb.toString(),list,null,null);
+    IResultSet set = database.performQuery(sb.toString(),list,null,null);
 
-        int i = 0;
-        while (i < set.getRowCount())
-        {
-          IResultRow row = set.getRow(i++);
-          Long jobID = (Long)row.getValue(jobs.idField);
+    int i = 0;
+    while (i < set.getRowCount())
+    {
+      IResultRow row = set.getRow(i++);
+      Long jobID = (Long)row.getValue(jobs.idField);
 
-          sb = new StringBuilder("SELECT ");
-          list.clear();
+      sb = new StringBuilder("SELECT ");
+      list.clear();
           
-          sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
-            .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-              new UnitaryClause(jobQueue.jobIDField,jobID),
-              new MultiClause(jobQueue.statusField,new Object[]{
-                jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
-                jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
-                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
-                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)})}))
-            .append(" ").append(database.constructOffsetLimitClause(0,1));
-
-          IResultSet confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
-
-          if (confirmSet.getRowCount() > 0)
-            continue;
-
-          // All the job's documents need to have their docpriority set to null, to clear
dead wood out of the docpriority index.
-          // See CONNECTORS-290.
-          // We do this BEFORE updating the job state.
-          jobQueue.clearDocPriorities(jobID);
+      sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
+        .append(database.buildConjunctionClause(list,new ClauseDescription[]{
+          new UnitaryClause(jobQueue.jobIDField,jobID),
+          new MultiClause(jobQueue.statusField,new Object[]{
+            jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
+            jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
+            jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
+            jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)})}))
+        .append(" ").append(database.constructOffsetLimitClause(0,1));
+
+      IResultSet confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
+
+      if (confirmSet.getRowCount() > 0)
+        continue;
+
+      // All the job's documents need to have their docpriority set to null, to clear dead
wood out of the docpriority index.
+      // See CONNECTORS-290.
+      // We do this BEFORE updating the job state.
+      jobQueue.clearDocPriorities(jobID);
           
-          int status = jobs.stringToStatus((String)row.getValue(jobs.statusField));
-          IJobDescription jobDesc = jobs.load(jobID,true);
-          abortJobs.add(jobDesc);
+      IJobDescription jobDesc = jobs.load(jobID,true);
+      modifiedJobs.add(jobDesc);
 
-          switch (status)
-          {
-          case Jobs.STATUS_ABORTING:
-            // Mark status of job as "inactive"
-            jobs.finishAbortJob(jobID,timestamp);
-            if (Logging.jobs.isDebugEnabled())
-            {
-              Logging.jobs.debug("Completed abort of job "+jobID);
-            }
-            break;
-          case Jobs.STATUS_ABORTINGFORRESTART:
-            // Do the restart sequence!  Log the abort here; the startup thread will log
the start.
-            jobs.startJob(jobID,null);
-            if (Logging.jobs.isDebugEnabled())
-            {
-              Logging.jobs.debug("Completed restart of job "+jobID);
-            }
-            break;
-          default:
-            throw new ManifoldCFException("Unexpected value for job status: "+Integer.toString(status));
-          }
-        }
-        return;
-      }
-      catch (ManifoldCFException e)
-      {
-        database.signalRollback();
-        if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
-        {
-          if (Logging.perf.isDebugEnabled())
-            Logging.perf.debug("Aborted finishing job aborts: "+e.getMessage());
-          sleepAmt = getRandomAmount();
-          continue;
-        }
-        throw e;
-      }
-      catch (Error e)
-      {
-        database.signalRollback();
-        throw e;
-      }
-      finally
+      jobs.finishStopJob(jobID,timestamp);
+          
+      if (Logging.jobs.isDebugEnabled())
       {
-        database.endTransaction();
-        sleepFor(sleepAmt);
+        Logging.jobs.debug("Stopped job "+jobID);
       }
     }
   }
@@ -6332,115 +6292,83 @@ public class JobManager implements IJobM
   public void resetJobs(long currentTime, ArrayList resetJobs)
     throws ManifoldCFException
   {
-    while (true)
-    {
-      long sleepAmt = 0L;
-      database.beginTransaction();
-      try
-      {
-        // Query for all jobs that fulfill the criteria
-        // The query used to look like:
-        //
-        // SELECT id FROM jobs t0 WHERE status='D' AND NOT EXISTS(SELECT 'x' FROM jobqueue
t1 WHERE
-        //      t0.id=t1.jobid AND t1.status='P')
-        //
-        // Now, the query is broken up, for performance
-
-        // Do the first query, getting the candidate jobs to be considered
-        StringBuilder sb = new StringBuilder("SELECT ");
-        ArrayList list = new ArrayList();
+    // Query for all jobs that fulfill the criteria
+    // The query used to look like:
+    //
+    // SELECT id FROM jobs t0 WHERE status='D' AND NOT EXISTS(SELECT 'x' FROM jobqueue t1
WHERE
+    //      t0.id=t1.jobid AND t1.status='P')
+    //
+    // Now, the query is broken up, for performance
+
+    // Do the first query, getting the candidate jobs to be considered
+    StringBuilder sb = new StringBuilder("SELECT ");
+    ArrayList list = new ArrayList();
         
-        sb.append(jobs.idField).append(" FROM ").append(jobs.getTableName()).append(" WHERE
")
-          .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-            new UnitaryClause(jobs.statusField,jobs.statusToString(jobs.STATUS_SHUTTINGDOWN))}))
-          .append(" FOR UPDATE");
+    sb.append(jobs.idField).append(" FROM ").append(jobs.getTableName()).append(" WHERE ")
+      .append(database.buildConjunctionClause(list,new ClauseDescription[]{
+        new UnitaryClause(jobs.statusField,jobs.statusToString(jobs.STATUS_SHUTTINGDOWN))}));
             
-        IResultSet set = database.performQuery(sb.toString(),list,null,null);
+    IResultSet set = database.performQuery(sb.toString(),list,null,null);
 
-        int i = 0;
-        while (i < set.getRowCount())
-        {
-          IResultRow row = set.getRow(i++);
-          Long jobID = (Long)row.getValue(jobs.idField);
+    int i = 0;
+    while (i < set.getRowCount())
+    {
+      IResultRow row = set.getRow(i++);
+      Long jobID = (Long)row.getValue(jobs.idField);
 
-          // Check to be sure the job is a candidate for shutdown
-          sb = new StringBuilder("SELECT ");
-          list.clear();
+      // Check to be sure the job is a candidate for shutdown
+      sb = new StringBuilder("SELECT ");
+      list.clear();
           
-          sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
-            .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-              new UnitaryClause(jobQueue.jobIDField,jobID),
-              new MultiClause(jobQueue.statusField,new Object[]{
-                jobQueue.statusToString(jobQueue.STATUS_PURGATORY),
-                jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)})}))
-            .append(" ").append(database.constructOffsetLimitClause(0,1));
-
-          IResultSet confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
-
-          if (confirmSet.getRowCount() > 0)
-            continue;
-
-          // The shutting-down phase is complete.  However, we need to check if there are
any outstanding
-          // PENDING or PENDINGPURGATORY records before we can decide what to do.
-          sb = new StringBuilder("SELECT ");
-          list.clear();
+      sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
+        .append(database.buildConjunctionClause(list,new ClauseDescription[]{
+          new UnitaryClause(jobQueue.jobIDField,jobID),
+          new MultiClause(jobQueue.statusField,new Object[]{
+            jobQueue.statusToString(jobQueue.STATUS_PURGATORY),
+            jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)})}))
+        .append(" ").append(database.constructOffsetLimitClause(0,1));
+
+      IResultSet confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
+
+      if (confirmSet.getRowCount() > 0)
+        continue;
+
+      // The shutting-down phase is complete.  However, we need to check if there are any
outstanding
+      // PENDING or PENDINGPURGATORY records before we can decide what to do.
+      sb = new StringBuilder("SELECT ");
+      list.clear();
           
-          sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
-            .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-              new UnitaryClause(jobQueue.jobIDField,jobID),
-              new MultiClause(jobQueue.statusField,new Object[]{
-                jobQueue.statusToString(jobQueue.STATUS_PENDING),
-                jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)})}))
-            .append(" ").append(database.constructOffsetLimitClause(0,1));
+      sb.append(jobQueue.idField).append(" FROM ").append(jobQueue.getTableName()).append("
WHERE ")
+        .append(database.buildConjunctionClause(list,new ClauseDescription[]{
+          new UnitaryClause(jobQueue.jobIDField,jobID),
+          new MultiClause(jobQueue.statusField,new Object[]{
+            jobQueue.statusToString(jobQueue.STATUS_PENDING),
+            jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)})}))
+        .append(" ").append(database.constructOffsetLimitClause(0,1));
 
-          confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
+      confirmSet = database.performQuery(sb.toString(),list,null,null,1,null);
 
-          if (confirmSet.getRowCount() > 0)
-          {
-            // This job needs to re-enter the active state.  Make that happen.
-            jobs.returnJobToActive(jobID);
-            if (Logging.jobs.isDebugEnabled())
-            {
-              Logging.jobs.debug("Job "+jobID+" is re-entering active state");
-            }
-          }
-          else
-          {
-            // This job should be marked as finished.
-            IJobDescription jobDesc = jobs.load(jobID,true);
-            resetJobs.add(jobDesc);
-            
-            // Label the job "finished"
-            jobs.finishJob(jobID,currentTime);
-            if (Logging.jobs.isDebugEnabled())
-            {
-              Logging.jobs.debug("Job "+jobID+" now completed");
-            }
-          }
-        }
-        return;
-      }
-      catch (ManifoldCFException e)
+      if (confirmSet.getRowCount() > 0)
       {
-        database.signalRollback();
-        if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
+        // This job needs to re-enter the active state.  Make that happen.
+        jobs.returnJobToActive(jobID);
+        if (Logging.jobs.isDebugEnabled())
         {
-          if (Logging.perf.isDebugEnabled())
-            Logging.perf.debug("Aborted resetting jobs: "+e.getMessage());
-          sleepAmt = getRandomAmount();
-          continue;
+          Logging.jobs.debug("Job "+jobID+" is re-entering active state");
         }
-        throw e;
-      }
-      catch (Error e)
-      {
-        database.signalRollback();
-        throw e;
       }
-      finally
+      else
       {
-        database.endTransaction();
-        sleepFor(sleepAmt);
+        // This job should be marked as finished.
+        IJobDescription jobDesc = jobs.load(jobID,true);
+        resetJobs.add(jobDesc);
+            
+        // Label the job "finished"
+        jobs.finishJob(jobID,currentTime);
+        if (Logging.jobs.isDebugEnabled())
+        {
+          Logging.jobs.debug("Job "+jobID+" now completed");
+        }
       }
     }
   }

Modified: incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java?rev=1205397&r1=1205396&r2=1205397&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
(original)
+++ incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
Wed Nov 23 13:51:23 2011
@@ -2030,26 +2030,83 @@ public class Jobs extends org.apache.man
     performUpdate(map,"WHERE "+query,list,new StringSet(getJobStatusKey()));
   }
 
-  /** Finish a job (abort).
-  * Write completion and the current time.
-  *@param jobID is the job id.
+  /** Stop a job suddenly (abort, pause, activewait).
+  * Updates the job record in a manner consistent with the job's state.
   */
-  public void finishAbortJob(Long jobID, long abortTime)
+  public void finishStopJob(Long jobID, long currentTime)
     throws ManifoldCFException
   {
-    ArrayList list = new ArrayList();
-    String query = buildConjunctionClause(list,new ClauseDescription[]{
-      new UnitaryClause(idField,jobID)});
-    HashMap map = new HashMap();
-    map.put(statusField,statusToString(STATUS_READYFORNOTIFY));
-    map.put(endTimeField,null);
-    map.put(lastTimeField,new Long(abortTime));
-    map.put(windowEndField,null);
-    map.put(reseedTimeField,null);
-    // Leave the error text around from the abort!
-    performUpdate(map,"WHERE "+query,list,new StringSet(getJobStatusKey()));
+    beginTransaction();
+    try
+    {
+      // Get the current job status
+      ArrayList list = new ArrayList();
+      String query = buildConjunctionClause(list,new ClauseDescription[]{
+        new UnitaryClause(idField,jobID)});
+      IResultSet set = performQuery("SELECT "+statusField+" FROM "+getTableName()+
+        " WHERE "+query+" FOR UPDATE",list,null,null);
+      if (set.getRowCount() == 0)
+        throw new ManifoldCFException("Job does not exist: "+jobID);
+      IResultRow row = set.getRow(0);
+      int status = stringToStatus(row.getValue(statusField).toString());
+      int newStatus;
+      HashMap map = new HashMap();
+      switch (status)
+      {
+      case STATUS_ABORTING:
+        // Mark status of job as "inactive"
+        map.put(statusField,statusToString(STATUS_READYFORNOTIFY));
+        map.put(endTimeField,null);
+        map.put(lastTimeField,new Long(currentTime));
+        map.put(windowEndField,null);
+        map.put(reseedTimeField,null);
+        break;
+      case STATUS_ABORTINGFORRESTART:
+        map.put(statusField,statusToString(STATUS_READYFORSTARTUP));
+        map.put(endTimeField,null);
+        // Make sure error is removed (from last time)
+        map.put(errorField,null);
+        map.put(windowEndField,null);
+        break;
+      case STATUS_PAUSING:
+        map.put(statusField,statusToString(STATUS_PAUSED));
+        break;
+      case STATUS_PAUSINGSEEDING:
+        map.put(statusField,statusToString(STATUS_PAUSEDSEEDING));
+        break;
+      case STATUS_ACTIVEWAITING:
+        map.put(statusField,statusToString(STATUS_ACTIVEWAIT));
+        break;
+      case STATUS_ACTIVEWAITINGSEEDING:
+        map.put(statusField,statusToString(STATUS_ACTIVEWAITSEEDING));
+        break;
+      case STATUS_PAUSINGWAITING:
+        map.put(statusField,statusToString(STATUS_PAUSEDWAIT));
+        break;
+      case STATUS_PAUSINGWAITINGSEEDING:
+        map.put(statusField,statusToString(STATUS_PAUSEDWAITSEEDING));
+        break;
+      default:
+        throw new ManifoldCFException("Unexpected value for job status: "+Integer.toString(status));
+      }
+      performUpdate(map,"WHERE "+query,list,new StringSet(getJobStatusKey()));
+    }
+    catch (ManifoldCFException e)
+    {
+      signalRollback();
+      throw e;
+    }
+    catch (Error e)
+    {
+      signalRollback();
+      throw e;
+    }
+    finally
+    {
+      endTransaction();
+    }
   }
-
+  
   /** Mark job as having properly notified the output connector of completion.
   *@param jobID is the job id.
   */

Modified: incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java?rev=1205397&r1=1205396&r2=1205397&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
(original)
+++ incubator/lcf/branches/CONNECTORS-290/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
Wed Nov 23 13:51:23 2011
@@ -63,12 +63,12 @@ public class JobResetThread extends Thre
         {
           // See if there are any completed jobs
           long currentTime = System.currentTimeMillis();
-          ArrayList jobAborts = new ArrayList();
-          jobManager.finishJobAborts(currentTime,jobAborts);
+          ArrayList jobStops = new ArrayList();
+          jobManager.finishJobStops(currentTime,jobStops);
           int k = 0;
-          while (k < jobAborts.size())
+          while (k < jobStops.size())
           {
-            IJobDescription desc = (IJobDescription)jobAborts.get(k++);
+            IJobDescription desc = (IJobDescription)jobStops.get(k++);
             connectionManager.recordHistory(desc.getConnectionName(),
               null,connectionManager.ACTIVITY_JOBABORT,null,
               desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
@@ -88,7 +88,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 (jobAborts.size() > 0)
+          if (jobStops.size() > 0)
           {
             Logging.threads.debug("Job reset thread reprioritizing documents...");
 



Mime
View raw message