incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1198541 - in /incubator/lcf/trunk: ./ framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ site/src/documentation/content/xdocs/ tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/
Date Sun, 06 Nov 2011 19:26:31 GMT
Author: kwright
Date: Sun Nov  6 19:26:31 2011
New Revision: 1198541

URL: http://svn.apache.org/viewvc?rev=1198541&view=rev
Log:
Finish CONNECTORS-285.

Modified:
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
    incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityHSQLDBIT.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
    incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityPostgresqlIT.java

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Sun Nov  6 19:26:31 2011
@@ -3,6 +3,11 @@ $Id$
 
 ======================= 0.4-dev =====================
 
+CONNECTORS-285: Provide a way through the IJobManager interface
+and through the API to check on the status of a job without asking
+for the counts of documents, which yields a full table scan.
+(Karl Wright)
+
 CONNECTORS-279: Prevent reindex or analyze from taking place within
 a transaction.  This was causing hangs on our load tests.
 (Karl Wright)

Modified: incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
(original)
+++ incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Sun Nov  6 19:26:31 2011
@@ -1441,6 +1441,26 @@ public class ManifoldCF extends org.apac
         createErrorNode(output,e);
       }
     }
+    else if (path.startsWith("jobstatusesnocounts/"))
+    {
+      String jobID = path.substring("jobstatusesnocounts/".length());
+
+      try
+      {
+        IJobManager jobManager = JobManagerFactory.make(tc);
+        JobStatus status = jobManager.getStatus(new Long(jobID),false);
+	if (status != null)
+        {
+          ConfigurationNode jobStatusNode = new ConfigurationNode(API_JOBSTATUSNODE);
+          formatJobStatus(jobStatusNode,status);
+          output.addChild(output.getChildCount(),jobStatusNode);
+        }
+      }
+      catch (ManifoldCFException e)
+      {
+        createErrorNode(output,e);
+      }
+    }
     else if (path.equals("outputconnections"))
     {
       try

Modified: incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml (original)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml Sun
Nov  6 19:26:31 2011
@@ -75,6 +75,7 @@
           <tr><td>jobs/<em>&lt;job_id&gt;</em></td><td>DELETE</td><td>Delete
a job definition</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>jobstatuses</td><td>GET</td><td>List
all jobs and their status</td><td>N/A</td><td>{"job":[<em>&lt;list_of_job_status_objects&gt;</em>]}
<strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>jobstatuses/<em>&lt;job_id&gt;</em></td><td>GET</td><td>Get
a specific job's status</td><td>N/A</td><td>{"jobstatus":<em>&lt;job_status_object&gt;</em>}
<strong>OR</strong> { } <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}
</td></tr>
+          <tr><td>jobstatusesnocounts/<em>&lt;job_id&gt;</em></td><td>GET</td><td>Get
a specific job's status, returning '0' for all counts</td><td>N/A</td><td>{"jobstatus":<em>&lt;job_status_object&gt;</em>}
<strong>OR</strong> { } <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}
</td></tr>
           <tr><td>start/<em>&lt;job_id&gt;</em></td><td>PUT</td><td>Start
a specified job manually</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>abort/<em>&lt;job_id&gt;</em></td><td>PUT</td><td>Abort
a specified job</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>restart/<em>&lt;job_id&gt;</em></td><td>PUT</td><td>Stop
and start a specified job</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityHSQLDBIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityHSQLDBIT.java?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityHSQLDBIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityHSQLDBIT.java
Sun Nov  6 19:26:31 2011
@@ -316,7 +316,7 @@ public class APISanityHSQLDBIT extends B
   protected String getJobStatus(String jobIDString)
     throws Exception
   {
-    Configuration result = performAPIGetOperationViaNodes("jobstatuses/"+jobIDString,200);
+    Configuration result = performAPIGetOperationViaNodes("jobstatusesnocounts/"+jobIDString,200);
     String status = null;
     int i = 0;
     while (i < result.getChildCount())

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityIT.java
Sun Nov  6 19:26:31 2011
@@ -316,7 +316,7 @@ public class APISanityIT extends Base
   protected String getJobStatus(String jobIDString)
     throws Exception
   {
-    Configuration result = performAPIGetOperationViaNodes("jobstatuses/"+jobIDString,200);
+    Configuration result = performAPIGetOperationViaNodes("jobstatusesnocounts/"+jobIDString,200);
     String status = null;
     int i = 0;
     while (i < result.getChildCount())

Modified: incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityPostgresqlIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityPostgresqlIT.java?rev=1198541&r1=1198540&r2=1198541&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityPostgresqlIT.java
(original)
+++ incubator/lcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/APISanityPostgresqlIT.java
Sun Nov  6 19:26:31 2011
@@ -316,7 +316,7 @@ public class APISanityPostgresqlIT exten
   protected String getJobStatus(String jobIDString)
     throws Exception
   {
-    Configuration result = performAPIGetOperationViaNodes("jobstatuses/"+jobIDString,200);
+    Configuration result = performAPIGetOperationViaNodes("jobstatusesnocounts/"+jobIDString,200);
     String status = null;
     int i = 0;
     while (i < result.getChildCount())



Mime
View raw message