manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1572539 - in /manifoldcf/trunk: CHANGES.txt framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
Date Thu, 27 Feb 2014 12:43:44 GMT
Author: kwright
Date: Thu Feb 27 12:43:44 2014
New Revision: 1572539

URL: http://svn.apache.org/r1572539
Log:
Fix for CONNECTORS-905.  Committed on behalf of Graeme Seaton

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1572539&r1=1572538&r2=1572539&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Thu Feb 27 12:43:44 2014
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.6-dev =====================
 
+CONNECTORS-905: Add property which disables history recording.
+(Graeme Seaton)
+
 CONNECTORS-904: JDBC Connector with MySQL should convert
 from binary columns to strings.
 (Karl Wright)

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java?rev=1572539&r1=1572538&r2=1572539&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/repository/RepositoryHistoryManager.java
Thu Feb 27 12:43:44 2014
@@ -60,6 +60,9 @@ public class RepositoryHistoryManager ex
   /** Thread context */
   protected IThreadContext threadContext;
 
+  /** A lock manager handle. */
+  protected final ILockManager lockManager;
+
   /** Constructor.
   *@param database is the database instance.
   */
@@ -68,6 +71,7 @@ public class RepositoryHistoryManager ex
   {
     super(database,"repohistory");
     this.threadContext = tc;
+    this.lockManager = LockManagerFactory.make(tc);
   }
 
   /** Install or upgrade the table.
@@ -188,22 +192,25 @@ public class RepositoryHistoryManager ex
     String entityIdentifier, String resultCode, String resultDescription)
     throws ManifoldCFException
   {
-    Long id = new Long(IDFactory.make(threadContext));
-    HashMap map = new HashMap();
-    map.put(idField,id);
-    map.put(ownerNameField,connectionName);
-    map.put(startTimeField,new Long(startTime));
-    map.put(endTimeField,new Long(endTime));
-    map.put(dataSizeField,new Long(dataSize));
-    map.put(activityTypeField,activityType);
-    map.put(entityIdentifierField,entityIdentifier);
-    if (resultCode != null)
-      map.put(resultCodeField,resultCode);
-    if (resultDescription != null)
-      map.put(resultDescriptionField,resultDescription);
-    performInsert(map,null);
-    // Not accurate, but best we can do without overhead
-    noteModifications(1,0,0);
+    Long id = new Long(IDFactory.make(threadContext));   
+    if (lockManager.getSharedConfiguration().getBooleanProperty("org.apache.manifoldcf.crawler.repository.store_history",true))
+    {
+      HashMap map = new HashMap();
+      map.put(idField,id);
+      map.put(ownerNameField,connectionName);
+      map.put(startTimeField,new Long(startTime));
+      map.put(endTimeField,new Long(endTime));
+      map.put(dataSizeField,new Long(dataSize));
+      map.put(activityTypeField,activityType);
+      map.put(entityIdentifierField,entityIdentifier);
+      if (resultCode != null)
+        map.put(resultCodeField,resultCode);
+      if (resultDescription != null)
+        map.put(resultDescriptionField,resultDescription);
+      performInsert(map,null);
+      // Not accurate, but best we can do without overhead
+      noteModifications(1,0,0);
+    }
     return id;
   }
 



Mime
View raw message