manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1465655 - in /manifoldcf/trunk: ./ framework/core/src/main/java/org/apache/manifoldcf/core/system/ framework/core/src/test/java/org/apache/manifoldcf/core/tests/ framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/ framew...
Date Mon, 08 Apr 2013 14:45:38 GMT
Author: kwright
Date: Mon Apr  8 14:45:38 2013
New Revision: 1465655

URL: http://svn.apache.org/r1465655
Log:
Include conditional diagnostics designed to help us either resolve CONNECTORS-590, or prove
that this problem is due to bugs in PostgreSQL or MySQL.

Added:
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/TrackerClass.java
      - copied unchanged from r1465654, manifoldcf/branches/CONNECTORS-590-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/TrackerClass.java
Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
    manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-590:r1425803-1464871
  Merged /manifoldcf/branches/CONNECTORS-590-2:r1464872-1465654

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java?rev=1465655&r1=1465654&r2=1465655&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
(original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
Mon Apr  8 14:45:38 2013
@@ -45,6 +45,7 @@ public class Logging
   public static Logger cache = null;
   public static Logger keystore = null;
   public static Logger perf = null;
+  public static Logger diagnostics = null;
 
   private static HashMap loggerTable = null;
   private static HashMap logLevelMap = null;
@@ -90,6 +91,7 @@ public class Logging
     cache = newLogger("org.apache.manifoldcf.cache");
     keystore = newLogger("org.apache.manifoldcf.keystore");
     perf = newLogger("org.apache.manifoldcf.perf");
+    diagnostics = newLogger("org.apache.manifoldcf.diagnostics");
   }
 
   /** Reset all loggers

Modified: manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java?rev=1465655&r1=1465654&r2=1465655&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
(original)
+++ manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
Mon Apr  8 14:45:38 2013
@@ -122,7 +122,8 @@ public class Base
   {
     output.append(
       "  <property name=\"org.apache.manifoldcf.logconfigfile\" value=\""+loggingFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"+
-      "  <property name=\"org.apache.manifoldcf.connectorsconfigurationfile\" value=\""+connectorFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"
+      "  <property name=\"org.apache.manifoldcf.connectorsconfigurationfile\" value=\""+connectorFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"+
+      "  <property name=\"org.apache.manifoldcf.diagnostics\" value=\"DEBUG\"/>\n"
     );
   }
   

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1465655&r1=1465654&r2=1465655&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Mon Apr  8 14:45:38 2013
@@ -644,13 +644,16 @@ public class JobManager implements IJobM
         hopCount.reset();
         // Clean up carrydown stuff
         carryDown.reset();
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         Logging.jobs.debug("Reset complete");
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -663,6 +666,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -686,12 +690,15 @@ public class JobManager implements IJobM
       try
       {
         jobQueue.resetDocumentWorkerStatus();
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -704,6 +711,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -731,7 +739,9 @@ public class JobManager implements IJobM
     throws ManifoldCFException
   {
     Logging.jobs.debug("Resetting doc deleting status");
+    TrackerClass.notePrecommit();
     jobQueue.resetDocDeleteWorkerStatus();
+    TrackerClass.noteCommit();
     Logging.jobs.debug("Reset complete");
   }
 
@@ -741,7 +751,9 @@ public class JobManager implements IJobM
     throws ManifoldCFException
   {
     Logging.jobs.debug("Resetting doc cleaning status");
+    TrackerClass.notePrecommit();
     jobQueue.resetDocCleanupWorkerStatus();
+    TrackerClass.noteCommit();
     Logging.jobs.debug("Reset complete");
   }
 
@@ -995,8 +1007,10 @@ public class JobManager implements IJobM
           rval[i++] = dd;
           jobQueue.setCleaningStatus(dd.getID());
         }
-        
+
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         
         if (Logging.perf.isDebugEnabled())
           Logging.perf.debug("Done pruning unindexable docs after "+new Long(System.currentTimeMillis()-startTime).toString()+"
ms.");
@@ -1007,11 +1021,13 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -1257,7 +1273,9 @@ public class JobManager implements IJobM
           i++;
         }
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         
         if (Logging.perf.isDebugEnabled())
           Logging.perf.debug("Done pruning unindexable docs after "+new Long(System.currentTimeMillis()-startTime).toString()+"
ms.");
@@ -1268,11 +1286,13 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -1820,7 +1840,9 @@ public class JobManager implements IJobM
           jobQueue.updateActiveRecord(dd.getID(),((Integer)statusMap.get(compositeDocID)).intValue());
         }
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         
         return new DocumentSetAndFlags(rval, rvalBoolean);
 
@@ -1828,6 +1850,7 @@ public class JobManager implements IJobM
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -1840,6 +1863,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -2325,7 +2349,9 @@ public class JobManager implements IJobM
 
             i++;
           }
+          TrackerClass.notePrecommit();
           database.performCommit();
+          TrackerClass.noteCommit();
           break;
         }
         catch (ManifoldCFException e)
@@ -2429,8 +2455,10 @@ public class JobManager implements IJobM
           ArrayList list = new ArrayList();
           String query = database.buildConjunctionClause(list,new ClauseDescription[]{
             new UnitaryClause(jobQueue.idField,dd.getID())});
+          TrackerClass.notePreread(dd.getID());
           IResultSet set = database.performQuery("SELECT "+jobQueue.statusField+" FROM "+jobQueue.getTableName()+"
WHERE "+
             query+" FOR UPDATE",list,null,null);
+          TrackerClass.noteRead(dd.getID());
           if (set.getRowCount() > 0)
           {
             IResultRow row = set.getRow(0);
@@ -2441,12 +2469,15 @@ public class JobManager implements IJobM
           }
           i++;
         }
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -2460,6 +2491,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -2577,8 +2609,10 @@ public class JobManager implements IJobM
           ArrayList list = new ArrayList();
           String query = database.buildConjunctionClause(list,new ClauseDescription[]{
             new UnitaryClause(jobQueue.idField,dd.getID())});
+          TrackerClass.notePreread(dd.getID());
           IResultSet set = database.performQuery("SELECT "+jobQueue.statusField+" FROM "+jobQueue.getTableName()+"
WHERE "+
             query+" FOR UPDATE",list,null,null);
+          TrackerClass.noteRead(dd.getID());
           if (set.getRowCount() > 0)
           {
             IResultRow row = set.getRow(0);
@@ -2606,12 +2640,15 @@ public class JobManager implements IJobM
         // Since hopcount inheritance and prerequisites came from the addDocument() method,
         // we don't delete them here.
         
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         return rval;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -2625,6 +2662,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -2986,17 +3024,21 @@ public class JobManager implements IJobM
           i++;
         }
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -3193,12 +3235,15 @@ public class JobManager implements IJobM
           i++;
         }
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -3211,6 +3256,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -3288,12 +3334,15 @@ public class JobManager implements IJobM
           i++;
         }
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -3306,6 +3355,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -3523,7 +3573,9 @@ public class JobManager implements IJobM
         if (legalLinkTypes.length > 0)
           hopCount.recordSeedReferences(jobID,legalLinkTypes,reorderedDocIDHashes,hopcountMethod);
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         
         if (Logging.perf.isDebugEnabled())
           Logging.perf.debug("Took "+new Long(System.currentTimeMillis()-startTime).toString()+"
ms to add "+Integer.toString(reorderedDocIDHashes.length)+
@@ -3544,6 +3596,7 @@ public class JobManager implements IJobM
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -3557,6 +3610,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -4153,7 +4207,9 @@ public class JobManager implements IJobM
         if (reactivateRemovedHopcountRecords)
           jobQueue.reactivateHopcountRemovedRecords(jobID);
 
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         
         if (Logging.perf.isDebugEnabled())
           Logging.perf.debug("Took "+new Long(System.currentTimeMillis()-startTime).toString()+"
ms to add "+Integer.toString(reorderedDocIDHashes.length)+
@@ -4173,6 +4229,7 @@ public class JobManager implements IJobM
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           sleepAmt = getRandomAmount();
@@ -4186,6 +4243,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally
@@ -5376,7 +5434,9 @@ public class JobManager implements IJobM
   {
     // No special treatment needed for hopcount or carrydown, since these all get deleted
at once
     // at the end of the job delete process.
+    TrackerClass.notePrecommit();
     jobQueue.prepareDeleteScan(jobID);
+    TrackerClass.noteCommit();
   }
   
   /** Prepare a job to be run.
@@ -5468,12 +5528,15 @@ public class JobManager implements IJobM
         }
 
         jobQueue.prepareFullScan(jobID);
+        TrackerClass.notePrecommit();
         database.performCommit();
+        TrackerClass.noteCommit();
         break;
       }
       catch (ManifoldCFException e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
         {
           if (Logging.perf.isDebugEnabled())
@@ -5486,6 +5549,7 @@ public class JobManager implements IJobM
       catch (Error e)
       {
         database.signalRollback();
+        TrackerClass.noteRollback();
         throw e;
       }
       finally

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java?rev=1465655&r1=1465654&r2=1465655&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
Mon Apr  8 14:45:38 2013
@@ -390,6 +390,8 @@ public class JobQueue extends org.apache
     // Reindex the jobqueue table, since we've probably made lots of bad tuples doing the
above operations.
     reindexTable();
     unconditionallyAnalyzeTables();
+
+    TrackerClass.noteGlobalChange("Restart");
   }
 
   /** Flip all records for a job that have status HOPCOUNTREMOVED back to PENDING.
@@ -407,6 +409,8 @@ public class JobQueue extends org.apache
       new UnitaryClause(jobIDField,jobID),
       new UnitaryClause(statusField,statusToString(STATUS_HOPCOUNTREMOVED))});
     performUpdate(map,"WHERE "+query,list,null);
+    
+    TrackerClass.noteJobChange(jobID,"Map HOPCOUNTREMOVED to PENDING");
   }
 
   /** Delete all records for a job that have status HOPCOUNTREMOVED.
@@ -464,6 +468,8 @@ public class JobQueue extends org.apache
         statusToString(STATUS_ACTIVEPURGATORY),
         statusToString(STATUS_ACTIVENEEDRESCANPURGATORY)})});
     performUpdate(map,"WHERE "+query,list,null);
+        
+    TrackerClass.noteGlobalChange("Reset document worker status");
   }
 
   /** Reset doc delete worker status.
@@ -479,6 +485,8 @@ public class JobQueue extends org.apache
     String query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(statusField,statusToString(STATUS_BEINGDELETED))});
     performUpdate(map,"WHERE "+query,list,null);
+      
+    TrackerClass.noteGlobalChange("Reset document delete worker status");
   }
 
   /** Reset doc cleaning worker status.
@@ -494,6 +502,8 @@ public class JobQueue extends org.apache
     String query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(statusField,statusToString(STATUS_BEINGCLEANED))});
     performUpdate(map,"WHERE "+query,list,null);
+      
+    TrackerClass.noteGlobalChange("Reset document cleanup worker status");
   }
 
   /** Prepare for a job delete pass.  This will not be called
@@ -545,6 +555,7 @@ public class JobQueue extends org.apache
     // Do an analyze, otherwise our plans are going to be crap right off the bat
     unconditionallyAnalyzeTables();
 
+    TrackerClass.noteJobChange(jobID,"Prepare delete scan");
   }
   
   /** Prepare for a "full scan" job.  This will not be called
@@ -595,6 +606,8 @@ public class JobQueue extends org.apache
     noteModifications(0,2,0);
     // Do an analyze, otherwise our plans are going to be crap right off the bat
     unconditionallyAnalyzeTables();
+        
+    TrackerClass.noteJobChange(jobID,"Prepare full scan");
   }
 
   /** Prepare for a "partial" job.  This is called ONLY when the job is inactive.
@@ -654,6 +667,8 @@ public class JobQueue extends org.apache
     noteModifications(0,1,0);
     // Do an analyze, otherwise our plans are going to be crap right off the bat
     unconditionallyAnalyzeTables();
+      
+    TrackerClass.noteJobChange(jobID,"Prepare incremental scan");
   }
 
   /** Delete ingested document identifiers (as part of deleting the owning job).
@@ -767,6 +782,7 @@ public class JobQueue extends org.apache
       // Leave doc priority unchanged.
       break;
     default:
+      TrackerClass.printForensics(recID, currentStatus);
       throw new ManifoldCFException("Unexpected jobqueue status - record id "+recID.toString()+",
expecting active status, saw "+Integer.toString(currentStatus));
     }
 
@@ -779,6 +795,8 @@ public class JobQueue extends org.apache
     String query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(idField,recID)});
     performUpdate(map,"WHERE "+query,list,null);
+      
+    TrackerClass.noteRecordChange(recID, newStatus, "Note completion");
   }
 
   /** Either mark a record as hopcountremoved, or set status to "rescan", depending on the
@@ -814,6 +832,7 @@ public class JobQueue extends org.apache
       // Leave doc priority unchanged.
       break;
     default:
+      TrackerClass.printForensics(recID, currentStatus);
       throw new ManifoldCFException("Unexpected jobqueue status - record id "+recID.toString()+",
expecting active status, saw "+Integer.toString(currentStatus));
     }
 
@@ -826,6 +845,7 @@ public class JobQueue extends org.apache
     String query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(idField,recID)});
     performUpdate(map,"WHERE "+query,list,null);
+    TrackerClass.noteRecordChange(recID, newStatus, "Update or hopcount remove");
     return rval;
   }
 
@@ -846,6 +866,7 @@ public class JobQueue extends org.apache
       newStatus = STATUS_ACTIVEPURGATORY;
       break;
     default:
+      TrackerClass.printForensics(id, currentStatus);
       throw new ManifoldCFException("Unexpected status value for jobqueue record "+id.toString()+";
got "+Integer.toString(currentStatus));
     }
 
@@ -856,6 +877,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, newStatus, "Make active");
   }
 
   /** Set the status on a record, including check time and priority.
@@ -887,6 +909,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, status, "Set status");
   }
 
   /** Set the status of a document to "being deleted".
@@ -901,6 +924,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, STATUS_BEINGDELETED, "Set deleting status");
   }
 
   /** Set the status of a document to be "no longer deleting" */
@@ -918,6 +942,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, STATUS_ELIGIBLEFORDELETE, "Set undeleting status");
   }
 
   /** Set the status of a document to "being cleaned".
@@ -932,6 +957,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, STATUS_BEINGCLEANED, "Set cleaning status");
   }
 
   /** Set the status of a document to be "no longer cleaning" */
@@ -949,6 +975,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(idField,id)});
     performUpdate(map,"WHERE "+query,list,null);
     noteModifications(0,1,0);
+    TrackerClass.noteRecordChange(id, STATUS_PURGATORY, "Set uncleaning status");
   }
 
   /** Remove multiple records entirely.
@@ -1040,6 +1067,7 @@ public class JobQueue extends org.apache
     case STATUS_PURGATORY:
       // Set the status and time both
       map.put(statusField,statusToString(STATUS_PENDINGPURGATORY));
+      TrackerClass.noteRecordChange(recordID, STATUS_PENDINGPURGATORY, "Update existing record
initial");
       if (desiredExecuteTime == -1L)
         map.put(checkTimeField,new Long(0L));
       else
@@ -1130,6 +1158,7 @@ public class JobQueue extends org.apache
     performInsert(map,null);
     prereqEventManager.addRows(recordID,prereqEvents);
     noteModifications(1,0,0);
+    TrackerClass.noteRecordChange(recordID, STATUS_PENDING, "Create initial");
   }
 
   /** Note the remaining documents that do NOT need to be queued.  These are noted so that
the
@@ -1317,6 +1346,7 @@ public class JobQueue extends org.apache
     case STATUS_UNCHANGED:
       // Set the status and time both
       map.put(statusField,statusToString(STATUS_PENDINGPURGATORY));
+      TrackerClass.noteRecordChange(recordID, STATUS_PENDINGPURGATORY, "Update existing");
       map.put(checkTimeField,new Long(desiredExecuteTime));
       map.put(checkActionField,actionToString(ACTION_RESCAN));
       map.put(failTimeField,null);
@@ -1334,6 +1364,7 @@ public class JobQueue extends org.apache
         // The document has been processed before, so it has to go into PENDINGPURGATORY.
         // Set the status and time both
         map.put(statusField,statusToString(STATUS_PENDINGPURGATORY));
+        TrackerClass.noteRecordChange(recordID, STATUS_PENDINGPURGATORY, "Update existing");
         map.put(checkTimeField,new Long(desiredExecuteTime));
         map.put(checkActionField,actionToString(ACTION_RESCAN));
         map.put(failTimeField,null);
@@ -1363,6 +1394,7 @@ public class JobQueue extends org.apache
         // Flip the state to the new one, and set the document priority at this time too
- it will be preserved when the
         // processing is completed.
         map.put(statusField,statusToString(STATUS_ACTIVENEEDRESCAN));
+        TrackerClass.noteRecordChange(recordID, STATUS_ACTIVENEEDRESCAN, "Update existing");
         map.put(checkTimeField,new Long(desiredExecuteTime));
         map.put(checkActionField,actionToString(ACTION_RESCAN));
         map.put(failTimeField,null);
@@ -1387,6 +1419,7 @@ public class JobQueue extends org.apache
         // Flip the state to the new one, and set the document priority at this time too
- it will be preserved when the
         // processing is completed.
         map.put(statusField,statusToString(STATUS_ACTIVENEEDRESCANPURGATORY));
+        TrackerClass.noteRecordChange(recordID, STATUS_ACTIVENEEDRESCANPURGATORY, "Update
existing");
         map.put(checkTimeField,new Long(desiredExecuteTime));
         map.put(checkActionField,actionToString(ACTION_RESCAN));
         map.put(failTimeField,null);
@@ -1454,6 +1487,8 @@ public class JobQueue extends org.apache
     performInsert(map,null);
     prereqEventManager.addRows(recordID,prereqEvents);
     noteModifications(1,0,0);
+    TrackerClass.noteRecordChange(recordID, STATUS_PENDING, "Create new");
+
   }
 
   // Methods to convert status strings to integers and back

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1465655&r1=1465654&r2=1465655&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Mon Apr  8 14:45:38 2013
@@ -647,11 +647,14 @@ public class ManifoldCF extends org.apac
   protected static class InitializationThread extends Thread
   {
 
-    protected QueueTracker queueTracker;
+    protected final QueueTracker queueTracker;
 
     public InitializationThread(QueueTracker queueTracker)
     {
+      super();
       this.queueTracker = queueTracker;
+      setName("Initialization thread");
+      setDaemon(true);
     }
 
     public void run()



Mime
View raw message