manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1635810 - in /manifoldcf/branches/dev_1x: ./ framework/ framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Date Fri, 31 Oct 2014 16:54:05 GMT
Author: kwright
Date: Fri Oct 31 16:54:04 2014
New Revision: 1635810

URL: http://svn.apache.org/r1635810
Log:
Pull up fix fix for CONNECTORS-1090 from trunk.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/framework/   (props changed)
    manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java
    manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1635809

Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk/framework:r1635809

Modified: manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java?rev=1635810&r1=1635809&r2=1635810&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java
(original)
+++ manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/JoinClause.java
Fri Oct 31 16:54:04 2014
@@ -24,14 +24,21 @@ public class JoinClause implements Claus
 {
   public static final String _rcsid = "@(#)$Id$";
 
-  protected String columnName;
-  protected String joinColumnName;
+  protected final String columnName;
+  protected final String joinColumnName;
+  protected final String operation;
   
   /** Construct */
   public JoinClause(String columnName, String joinColumnName)
   {
+    this(columnName,joinColumnName,"=");
+  }
+  
+  public JoinClause(String columnName, String joinColumnName, String operation)
+  {
     this.columnName = columnName;
     this.joinColumnName = joinColumnName;
+    this.operation = "=";
   }
   
   /** Get the column name */
@@ -43,7 +50,7 @@ public class JoinClause implements Claus
   /** Get the operation string */
   public String getOperation()
   {
-    return "=";
+    return operation;
   }
   
   /** Get the individual values */

Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1635810&r1=1635809&r2=1635810&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Fri Oct 31 16:54:04 2014
@@ -1522,18 +1522,17 @@ public class JobManager implements IJobM
           
           sb.append("NOT EXISTS(SELECT 'x' FROM ").append(jobQueue.getTableName()).append("
t2 WHERE ")
             .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-              new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField)})).append("
AND ")
-            .append("t2.").append(jobQueue.statusField).append(" IN (?,?,?,?,?,?) AND ")
-            .append("t2.").append(jobQueue.jobIDField).append("!=t0.").append(jobQueue.jobIDField)
+              new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField),
+              new MultiClause("t2."+jobQueue.statusField,new String[]{
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY),
+                jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED),
+                jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)}),
+              new JoinClause("t2."+jobQueue.jobIDField,"t0."+jobQueue.jobIDField,"!=")}))
             .append(") ");
             
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED));
-
           sb.append(database.constructOffsetLimitClause(0,maxCount));
           
           // The checktime is null field check is for backwards compatibility
@@ -1765,18 +1764,17 @@ public class JobManager implements IJobM
             
           sb.append("NOT EXISTS(SELECT 'x' FROM ").append(jobQueue.getTableName()).append("
t2 WHERE ")
             .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-              new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField)})).append("
AND ")
-            .append("t2.").append(jobQueue.statusField).append(" IN (?,?,?,?,?,?) AND ")
-            .append("t2.").append(jobQueue.jobIDField).append("!=t0.").append(jobQueue.jobIDField)
+              new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField),
+              new MultiClause("t2."+jobQueue.statusField,new String[]{
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
+                jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY),
+                jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED),
+                jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)}),
+              new JoinClause("t2."+jobQueue.jobIDField,"t0."+jobQueue.jobIDField,"!=")}))
             .append(") ");
             
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED));
-          list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED));
-          
           sb.append(database.constructOffsetLimitClause(0,maxCount));
           
           // The checktime is null field check is for backwards compatibility
@@ -2304,16 +2302,16 @@ public class JobManager implements IJobM
     
     sb.append("NOT EXISTS(SELECT 'x' FROM ").append(jobQueue.getTableName()).append(" t2
WHERE ")
       .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-        new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField)})).append("
AND ")
-      .append("t2.").append(jobQueue.statusField).append(" IN (?,?,?,?,?,?)").append(" AND
")
-      .append("t2.").append(jobQueue.jobIDField).append("!=t0.").append(jobQueue.jobIDField).append(")
");
-
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED));
+        new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField),
+        new MultiClause("t2."+jobQueue.statusField,new String[]{
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY),
+          jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED),
+          jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)}),
+        new JoinClause("t2."+jobQueue.jobIDField,"t0."+jobQueue.jobIDField,"!=")}))
+      .append(") ");
 
     sb.append(database.constructOffsetLimitClause(0,n));
 
@@ -2854,18 +2852,17 @@ public class JobManager implements IJobM
     
     sb.append("NOT EXISTS(SELECT 'x' FROM ").append(jobQueue.getTableName()).append(" t2
WHERE ")
       .append(database.buildConjunctionClause(list,new ClauseDescription[]{
-        new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField)})).append("
AND ")
-      .append("t2.").append(jobQueue.statusField).append(" IN (?,?,?,?,?,?) AND ")
-      .append("t2.").append(jobQueue.jobIDField).append("!=t0.").append(jobQueue.jobIDField)
+        new JoinClause("t2."+jobQueue.docHashField,"t0."+jobQueue.docHashField),
+        new MultiClause("t2."+jobQueue.statusField,new String[]{
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
+          jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY),
+          jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED),
+          jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)}),
+        new JoinClause("t2."+jobQueue.jobIDField,"t0."+jobQueue.jobIDField,"!=")}))
       .append(") AND ");
 
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVE));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED));
-    list.add(jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED));
-        
     // Prerequisite event clause: AND NOT EXISTS(SELECT 'x' FROM prereqevents t3,events t4
WHERE t3.ownerid=t0.id AND t3.name=t4.name)
     sb.append("NOT EXISTS(SELECT 'x' FROM ").append(jobQueue.prereqEventManager.getTableName()).append("
t3,").append(eventManager.getTableName()).append(" t4 WHERE t0.")
       .append(jobQueue.idField).append("=t3.").append(jobQueue.prereqEventManager.ownerField).append("
AND t3.")



Mime
View raw message