incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1221587 - in /incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler: jobs/JobManager.java repository/RepositoryHistoryManager.java
Date Wed, 21 Dec 2011 03:26:18 GMT
Author: kwright
Date: Wed Dec 21 03:26:17 2011
New Revision: 1221587

URL: http://svn.apache.org/viewvc?rev=1221587&view=rev
Log:
Missed a bit of the merge, part of CONNECTORS-334.

Modified:
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java

Modified: incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1221587&r1=1221586&r2=1221587&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Wed Dec 21 03:26:17 2011
@@ -6574,7 +6574,7 @@ public class JobManager implements IJobM
       ArrayList list = new ArrayList();
       
       sb.append(JobQueue.jobIDField).append(",")
-        .append("CAST(COUNT(").append(JobQueue.docHashField).append(") AS BIGINT) AS doccount")
+        .append(database.constructCountClause(JobQueue.docHashField)).append(" AS doccount")
         .append(" FROM ").append(jobQueue.getTableName()).append(" t1");
       
       if (whereClause != null)
@@ -6595,7 +6595,7 @@ public class JobManager implements IJobM
       list.clear();
       
       sb.append(JobQueue.jobIDField).append(",")
-        .append("CAST(COUNT(").append(JobQueue.docHashField).append(") AS BIGINT) AS doccount")
+        .append(database.constructCountClause(JobQueue.docHashField)).append(" AS doccount")
         .append(" FROM ").append(jobQueue.getTableName()).append(" t1 WHERE ")
         .append(database.buildConjunctionClause(list,new ClauseDescription[]{
           new MultiClause(JobQueue.statusField,new Object[]{
@@ -6623,7 +6623,7 @@ public class JobManager implements IJobM
       list.clear();
       
       sb.append(JobQueue.jobIDField).append(",")
-        .append("CAST(COUNT(").append(JobQueue.docHashField).append(") AS BIGINT) AS doccount")
+        .append(database.constructCountClause(JobQueue.docHashField)).append(" AS doccount")
         .append(" FROM ").append(jobQueue.getTableName()).append(" t1 WHERE ")
         .append(database.buildConjunctionClause(list,new ClauseDescription[]{
           new MultiClause(JobQueue.statusField,new Object[]{

Modified: incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java?rev=1221587&r1=1221586&r2=1221587&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
(original)
+++ incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
Wed Dec 21 03:26:17 2011
@@ -298,15 +298,16 @@ public class RepositoryHistoryManager ex
   public long countHistoryRows(String connectionName, FilterCriteria criteria)
     throws ManifoldCFException
   {
-    StringBuilder sb = new StringBuilder("SELECT COUNT(*) AS countcol FROM ");
+    StringBuilder sb = new StringBuilder("SELECT ");
     ArrayList list = new ArrayList();
+    sb.append(constructCountClause("*")).append(" AS countcol FROM ");
     sb.append(getTableName());
     addCriteria(sb,list,"",connectionName,criteria,false);
     IResultSet set = performQuery(sb.toString(),list,null,null);
     if (set.getRowCount() < 1)
       throw new ManifoldCFException("Expected at least one row");
     IResultRow row = set.getRow(0);
-    Long value = new Long(row.getValue("countcol").toString());
+    Long value = (Long)row.getValue("countcol");
     return value.longValue();
   }
 
@@ -551,8 +552,9 @@ public class RepositoryHistoryManager ex
     //              GROUP BY t1.resultcodebucket,t1.idbucket
     //                      ORDER BY xxx LIMIT yyy OFFSET zzz
 
-    StringBuilder sb = new StringBuilder("SELECT t1.resultcodebucket,t1.idbucket,COUNT('x')
AS eventcount FROM (SELECT ");
+    StringBuilder sb = new StringBuilder("SELECT t1.resultcodebucket,t1.idbucket,");
     ArrayList list = new ArrayList();
+    sb.append(constructCountClause("'x'")).append(" AS eventcount FROM (SELECT ");
     addBucketExtract(sb,list,"",resultCodeField,resultCodeBucket);
     sb.append(" AS resultcodebucket, ");
     addBucketExtract(sb,list,"",entityIdentifierField,idBucket);



Mime
View raw message