incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r952302 - in /incubator/lcf/trunk/modules/framework: agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java core/org/apache/lcf/core/database/DBInterfaceDerby.java pull-agent/org/apache/lcf/crawler/system/LCF.java
Date Mon, 07 Jun 2010 16:07:04 GMT
Author: kwright
Date: Mon Jun  7 16:07:04 2010
New Revision: 952302

URL: http://svn.apache.org/viewvc?rev=952302&view=rev
Log:
Fix two problems: (1) a derby issue with rollback, and (2) a derby issue with the ingeststatus
table.  Also install logging for agent start and agent shutdown.

Modified:
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java
    incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/database/DBInterfaceDerby.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/system/LCF.java

Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java?rev=952302&r1=952301&r2=952302&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java
(original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/incrementalingest/IncrementalIngester.java
Mon Jun  7 16:07:04 2010
@@ -365,10 +365,11 @@ public class IncrementalIngester extends
         // Delete all records from the database that match the old URI, except for THIS record.
         list.clear();
         list.add(oldURIHash);
-        list.add(oldURI);
+	// Ideally, we should include the actual string, but that's hard because of database limitations
+        //list.add(oldURI);
         list.add(docKey);
         list.add(connection.getName());
-        performDelete("WHERE "+uriHashField+"=? AND "+docURIField+"=? AND "+docKeyField+"!=?
AND "+outputConnNameField+"=?",list,null);
+        performDelete("WHERE "+uriHashField+"=? AND "+ /* docURIField+"=? AND "+ */ docKeyField+"!=?
AND "+outputConnNameField+"=?",list,null);
         removeDocument(connection,oldURI,oldOutputVersion,activities);
       }
 
@@ -377,10 +378,11 @@ public class IncrementalIngester extends
         // Get rid of all records that match the NEW uri, except for this record.
         list.clear();
         list.add(documentURIHash);
-        list.add(documentURI);
+        // Database limitations prevent this
+        // list.add(documentURI);
         list.add(docKey);
         list.add(connection.getName());
-        performDelete("WHERE "+uriHashField+"=? AND "+docURIField+"=? AND "+docKeyField+"!=?
AND "+outputConnNameField+"=?",list,null);
+        performDelete("WHERE "+uriHashField+"=? AND "+ /* docURIField+"=? AND "+ */ docKeyField+"!=?
AND "+outputConnNameField+"=?",list,null);
       }
 
       // Now, we know we are ready for the ingest.

Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/database/DBInterfaceDerby.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/database/DBInterfaceDerby.java?rev=952302&r1=952301&r2=952302&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/database/DBInterfaceDerby.java
(original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/database/DBInterfaceDerby.java
Mon Jun  7 16:07:04 2010
@@ -987,8 +987,11 @@ public class DBInterfaceDerby extends Da
       {
         try
         {
-          connection.commit();
-          connection.setAutoCommit(true);
+          if (connection != null)
+          {
+            connection.commit();
+            connection.setAutoCommit(true);
+          }
         }
         catch (java.sql.SQLException e)
         {
@@ -1012,8 +1015,11 @@ public class DBInterfaceDerby extends Da
       {
         try
         {
-          connection.rollback();
-          connection.setAutoCommit(true);
+          if (connection != null)
+          {
+            connection.rollback();
+            connection.setAutoCommit(true);
+          }
         }
         catch (java.sql.SQLException e)
         {

Modified: incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/system/LCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/system/LCF.java?rev=952302&r1=952301&r2=952302&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/system/LCF.java
(original)
+++ incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/system/LCF.java
Mon Jun  7 16:07:04 2010
@@ -133,6 +133,7 @@ public class LCF extends org.apache.lcf.
   public static void startSystem(IThreadContext threadContext)
     throws LCFException
   {
+    Logging.root.info("Starting up pull-agent...");
     synchronized (startupLock)
     {
       // Now, start all the threads
@@ -222,6 +223,7 @@ public class LCF extends org.apache.lcf.
       // Start the initialization thread.  This does the initialization work and starts all
the other threads when that's done.  It then exits.
       initializationThread.start();
     }
+    Logging.root.info("Pull-agent started");
   }
 
   protected static class InitializationThread extends Thread
@@ -337,6 +339,7 @@ public class LCF extends org.apache.lcf.
   public static void stopSystem(IThreadContext threadContext)
     throws LCFException
   {
+    Logging.root.info("Shutting down pull-agent...");
     synchronized (startupLock)
     {
       while (initializationThread != null || jobDeleteThread != null || startupThread !=
null || jobStartThread != null || stufferThread != null ||
@@ -563,6 +566,7 @@ public class LCF extends org.apache.lcf.
       numDeleteThreads = 0;
       numExpireThreads = 0;
     }
+    Logging.root.info("Pull-agent successfully shut down");
   }
 
   /** Atomically export the crawler configuration */



Mime
View raw message