manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1185269 - in /incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs: Carrydown.java HopCount.java IntrinsicLink.java JobManager.java JobQueue.java Jobs.java
Date Mon, 17 Oct 2011 15:45:48 GMT
Author: kwright
Date: Mon Oct 17 15:45:48 2011
New Revision: 1185269

URL: http://svn.apache.org/viewvc?rev=1185269&view=rev
Log:
Change all queries to use IN() instead of multi-clause ORs.

Modified:
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Carrydown.java
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/IntrinsicLink.java
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
    incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Carrydown.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Carrydown.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Carrydown.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Carrydown.java
Mon Oct 17 15:45:48 2011
@@ -480,7 +480,7 @@ public class Carrydown extends org.apach
 
     // Restore new values
     sb = new StringBuilder("WHERE (");
-    sb.append(query).append(") AND (").append(newField).append("=? OR ").append(newField).append("=?)");
+    sb.append(query).append(") AND ").append(newField).append(" IN (?,?)");
     list.add(statusToString(ISNEW_EXISTING));
     list.add(statusToString(ISNEW_NEW));
     HashMap map = new HashMap();

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
Mon Oct 17 15:45:48 2011
@@ -454,21 +454,21 @@ public class HopCount extends org.apache
           StringBuilder sb = new StringBuilder("SELECT ");
           sb.append(idField).append(",").append(distanceField).append(",").append(linkTypeField)
             .append(" FROM ").append(getTableName()).append(" WHERE ");
-          int i = 0;
-          while (i < legalLinkTypes.length)
+          sb.append(jobIDField).append("=? AND ").append(linkTypeField).append(" IN (");
+          list.add(jobID);
+          for (int i = 0 ; i < legalLinkTypes.length ; i++)
           {
             if (i > 0)
-              sb.append(" OR ");
-            sb.append("(").append(jobIDField).append("=? AND ")
-              .append(linkTypeField).append("=? AND ").append(parentIDHashField).append("=?)");
-            list.add(jobID);
-            list.add(legalLinkTypes[i++]);
-            list.add(sourceDocumentIDHash);
+              sb.append(",");
+            sb.append("?");
+            list.add(legalLinkTypes[i]);
           }
+          sb.append(") AND ").append(parentIDHashField).append("=?");
+          list.add(sourceDocumentIDHash);
 
           IResultSet set = performQuery(sb.toString(),list,null,null);
           HashMap answerMap = new HashMap();
-          i = 0;
+          int i = 0;
           while (i < estimates.length)
           {
             estimates[i] = new Answer(ANSWER_INFINITY);

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/IntrinsicLink.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/IntrinsicLink.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/IntrinsicLink.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/IntrinsicLink.java
Mon Oct 17 15:45:48 2011
@@ -187,7 +187,7 @@ public class IntrinsicLink extends org.a
     map.put(newField,statusToString(LINKSTATUS_BASE));
     list.add(statusToString(LINKSTATUS_NEW));
     list.add(statusToString(LINKSTATUS_EXISTING));
-    performUpdate(map,"WHERE "+newField+"=? OR "+newField+"=?",list,null);
+    performUpdate(map,"WHERE "+newField+" IN (?,?)",list,null);
   }
 
   /** Record a references from source to targets.  These references will be marked as either
"new" or "existing".
@@ -463,7 +463,7 @@ public class IntrinsicLink extends org.a
     throws ManifoldCFException
   {
     StringBuilder sb = new StringBuilder("WHERE (");
-    sb.append(query).append(") AND (").append(newField).append("=? OR ").append(newField).append("=?)");
+    sb.append(query).append(") AND ").append(newField).append(" IN (?,?)");
     list.add(statusToString(LINKSTATUS_EXISTING));
     list.add(statusToString(LINKSTATUS_NEW));
     HashMap map = new HashMap();

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Mon Oct 17 15:45:48 2011
@@ -2076,8 +2076,8 @@ public class JobManager implements IJobM
       .append(jobQueue.checkTimeField).append("<=? AND (")
       .append(jobQueue.checkActionField).append(" IS NULL OR ")
       .append(jobQueue.checkActionField).append("=?")
-      .append(") AND (")
-      .append(jobQueue.statusField).append("=? OR ").append(jobQueue.statusField).append("=?)")
+      .append(") AND ")
+      .append(jobQueue.statusField).append(" IN (?,?)")
       .append(" ORDER BY ").append(jobQueue.docPriorityField).append(" ASC ").append(database.constructOffsetLimitClause(0,1));
 
 
@@ -5872,25 +5872,16 @@ public class JobManager implements IJobM
           list.clear();
           list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_PENDING));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY));
 
           IResultSet confirmSet = database.performQuery("SELECT "+jobQueue.idField+" FROM
"+
-            jobQueue.getTableName()+" WHERE "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) "+database.constructOffsetLimitClause(0,1),list,null,null,1,null);
+            jobQueue.getTableName()+" WHERE "+jobQueue.jobIDField+"=? AND "+
+            jobQueue.statusField+" IN (?,?,?,?,?,?) "+
+            database.constructOffsetLimitClause(0,1),list,null,null,1,null);
 
           if (confirmSet.getRowCount() > 0)
             continue;
@@ -6024,19 +6015,13 @@ public class JobManager implements IJobM
           list.clear();
           list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
 
           IResultSet confirmSet = database.performQuery("SELECT "+jobQueue.idField+" FROM
"+
-            jobQueue.getTableName()+" WHERE "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) "+database.constructOffsetLimitClause(0,1),list,null,null,1,null);
+            jobQueue.getTableName()+" WHERE "+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"
IN (?,?,?,?) "+
+            database.constructOffsetLimitClause(0,1),list,null,null,1,null);
 
           if (confirmSet.getRowCount() > 0)
             continue;
@@ -6135,13 +6120,12 @@ public class JobManager implements IJobM
           list.clear();
           list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_PURGATORY));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED));
 
           IResultSet confirmSet = database.performQuery("SELECT "+jobQueue.idField+" FROM
"+
-            jobQueue.getTableName()+" WHERE "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) "+database.constructOffsetLimitClause(0,1),list,null,null,1,null);
+            jobQueue.getTableName()+" WHERE "+jobQueue.jobIDField+"=? AND "+
+            jobQueue.statusField+" IN (?,?) "+
+            database.constructOffsetLimitClause(0,1),list,null,null,1,null);
 
           if (confirmSet.getRowCount() > 0)
             continue;
@@ -6151,13 +6135,12 @@ public class JobManager implements IJobM
           list.clear();
           list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_PENDING));
-          list.add(jobID);
           list.add(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY));
 
           confirmSet = database.performQuery("SELECT "+jobQueue.idField+" FROM "+
-            jobQueue.getTableName()+" WHERE "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) OR "+
-            "("+jobQueue.jobIDField+"=? AND "+jobQueue.statusField+"=?) "+database.constructOffsetLimitClause(0,1),list,null,null,1,null);
+            jobQueue.getTableName()+" WHERE "+jobQueue.jobIDField+"=? AND "+
+            jobQueue.statusField+" IN (?,?) "+
+            database.constructOffsetLimitClause(0,1),list,null,null,1,null);
 
           if (confirmSet.getRowCount() > 0)
           {
@@ -6553,62 +6536,41 @@ public class JobManager implements IJobM
       .append(" END AS state,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=? OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Inactive'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
       .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Ready for processing'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
       .append(" AND t0.").append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Ready for expiration'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
       .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Waiting for processing'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
       .append(" AND t0.").append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Waiting for expiration'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkTimeField).append(" IS NULL")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Waiting forever'")
-      .append(" WHEN (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" WHEN ").append("t0.").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 'Deleting'")
       .append(" WHEN ")
       .append("(t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?,?,?)")
       .append(" THEN 'Processing'")
       .append(" WHEN ")
       .append("t0.").append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append("t0.").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append("t0.").append(jobQueue.statusField).append(" IN (?,?,?,?)")
       .append(" THEN 'Expiring'")
       .append(" ELSE 'Unknown'")
       .append(" END AS status,")
@@ -6700,39 +6662,27 @@ public class JobManager implements IJobM
     sb.append(" AS idbucket,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" AS inactive,")
       .append("CASE")
       .append(" WHEN ")
       .append("(").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?,?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processing,")
       .append("CASE")
       .append(" WHEN ")
       .append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?,?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expiring,")
       .append("CASE")
       .append(" WHEN ")
-      .append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
+      .append(jobQueue.statusField).append(" IN (?,?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as deleting,")
@@ -6740,9 +6690,7 @@ public class JobManager implements IJobM
       .append(" WHEN ")
       .append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
       .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processready,")
@@ -6750,9 +6698,7 @@ public class JobManager implements IJobM
       .append(" WHEN ")
       .append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
       .append(" AND ").append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expireready,")
@@ -6760,9 +6706,7 @@ public class JobManager implements IJobM
       .append(" WHEN ")
       .append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
       .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=?)")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processwaiting,")
@@ -6770,18 +6714,14 @@ public class JobManager implements IJobM
       .append(" WHEN ")
       .append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
       .append(" AND ").append(jobQueue.checkActionField).append("=?")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expirewaiting,")
       .append("CASE")
       .append(" WHEN ")
       .append(jobQueue.checkTimeField).append(" IS NULL")
-      .append(" AND (").append(jobQueue.statusField).append("=?")
-      .append(" OR ").append(jobQueue.statusField).append("=?")
-      .append(")")
+      .append(" AND ").append(jobQueue.statusField).append(" IN (?,?)")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as waitingforever");

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
Mon Oct 17 15:45:48 2011
@@ -320,14 +320,14 @@ public class JobQueue extends org.apache
     ArrayList list = new ArrayList();
     list.add(statusToString(STATUS_ACTIVE));
     list.add(statusToString(STATUS_ACTIVENEEDRESCAN));
-    performUpdate(map,"WHERE "+statusField+"=? OR "+statusField+"=?",list,null);
+    performUpdate(map,"WHERE "+statusField+" IN (?,?)",list,null);
 
     // Map ACTIVEPURGATORY to PENDINGPURGATORY
     map.put(statusField,statusToString(STATUS_PENDINGPURGATORY));
     list.clear();
     list.add(statusToString(STATUS_ACTIVEPURGATORY));
     list.add(statusToString(STATUS_ACTIVENEEDRESCANPURGATORY));
-    performUpdate(map,"WHERE "+statusField+"=? OR "+statusField+"=?",list,null);
+    performUpdate(map,"WHERE "+statusField+" IN (?,?)",list,null);
 
     // Map BEINGDELETED to ELIGIBLEFORDELETE
     map.put(statusField,statusToString(STATUS_ELIGIBLEFORDELETE));
@@ -388,14 +388,14 @@ public class JobQueue extends org.apache
     ArrayList list = new ArrayList();
     list.add(statusToString(STATUS_ACTIVE));
     list.add(statusToString(STATUS_ACTIVENEEDRESCAN));
-    performUpdate(map,"WHERE "+statusField+"=? OR "+statusField+"=?",list,null);
+    performUpdate(map,"WHERE "+statusField+" IN (?,?)",list,null);
 
     // Map ACTIVEPURGATORY to PENDINGPURGATORY
     map.put(statusField,statusToString(STATUS_PENDINGPURGATORY));
     list.clear();
     list.add(statusToString(STATUS_ACTIVEPURGATORY));
     list.add(statusToString(STATUS_ACTIVENEEDRESCANPURGATORY));
-    performUpdate(map,"WHERE "+statusField+"=? OR "+statusField+"=?",list,null);
+    performUpdate(map,"WHERE "+statusField+" IN (?,?)",list,null);
   }
 
   /** Reset doc delete worker status.

Modified: incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java?rev=1185269&r1=1185268&r2=1185269&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
(original)
+++ incubator/lcf/branches/CONNECTORS-100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
Mon Oct 17 15:45:48 2011
@@ -766,7 +766,7 @@ public class Jobs extends org.apache.man
       list.add(statusToString(STATUS_STARTINGUP));
       list.add(statusToString(STATUS_ABORTINGSTARTINGUP));
       map.put(statusField,statusToString(STATUS_READYFORSTARTUP));
-      performUpdate(map,"WHERE "+statusField+"=? OR "+statusField+"=?",list,invKey);
+      performUpdate(map,"WHERE "+statusField+" IN (?,?)",list,invKey);
 
       // Aborting starting up for restart state goes to ABORTINGFORRESTART
       list.clear();



Mime
View raw message