manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1849001 - in /manifoldcf/trunk: CHANGES.txt framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java
Date Sat, 15 Dec 2018 17:47:31 GMT
Author: kwright
Date: Sat Dec 15 17:47:31 2018
New Revision: 1849001

URL: http://svn.apache.org/viewvc?rev=1849001&view=rev
Log:
Final fix for CONNECTORS-1562.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1849001&r1=1849000&r2=1849001&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Sat Dec 15 17:47:31 2018
@@ -3,6 +3,12 @@ $Id$
 
 ======================= 2.12-dev =====================
 
+CONNECTORS-1562: HopDeleteDeps table was using NULL values instead of empty
+strings, but nothing else knew about this and therefore all queries involving invalidation
+that used empty strings would not work as expected.  This was a long-standing problem,
+in effect since at least 2012.
+(Karl Wright, Tim Steenbeke)
+
 CONNECTORS-1522: Add SSL and basic auth support to ElasticSearch connector.
 (Karl Wright, Steph van Schwalkwyk)
 

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java?rev=1849001&r1=1849000&r2=1849001&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopCount.java
Sat Dec 15 17:47:31 2018
@@ -1017,7 +1017,19 @@ public class HopCount extends org.apache
       // Invalidate all links with the given source documents.
       // This basically should make sure reassessment of all referenced documents takes place.
       // It also deletes the intrinsic links that no longer exist.
+      if (Logging.hopcount.isDebugEnabled()) {
+        final StringBuilder sb = new StringBuilder();
+        for (String sourceID : sourceDocumentHashes) {
+          sb.append(" '").append(sourceID).append("' ");
+        }
+        final StringBuilder sb2 = new StringBuilder();
+        for (String lt : legalLinkTypes) {
+          sb2.append(" '").append(lt).append("' ");
+        }
+        Logging.hopcount.debug("Invalidating hopcount records for job "+jobID+" legalLinkTypes:
["+sb2+"] sourceDocumentHashes: ["+sb+"]...");
+      }
       doDeleteInvalidation(jobID,sourceDocumentHashes);
+      Logging.hopcount.debug("... invalidated");
     }
     // Make all new and existing links become just "base" again.
     intrinsicLinkManager.restoreLinks(jobID,sourceDocumentHashes);

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java?rev=1849001&r1=1849000&r2=1849001&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/HopDeleteDeps.java
Sat Dec 15 17:47:31 2018
@@ -211,12 +211,8 @@ public class HopDeleteDeps extends org.a
     String query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(ownerIDField,ownerID),
       new UnitaryClause(parentIDHashField,dd.getParentIDHash()),
-      (dd.getLinkType().length() > 0)?
-        new UnitaryClause(linkTypeField,dd.getLinkType()):
-        new NullCheckClause(linkTypeField,true),
-      (dd.getChildIDHash().length() > 0)?
-        new UnitaryClause(childIDHashField,dd.getChildIDHash()):
-        new NullCheckClause(childIDHashField,true)});
+      new UnitaryClause(linkTypeField,dd.getLinkType()),
+      new UnitaryClause(childIDHashField,dd.getChildIDHash())});
         
     performDelete("WHERE "+query,list,null);
     noteModifications(0,0,1);
@@ -233,13 +229,9 @@ public class HopDeleteDeps extends org.a
     HashMap map = new HashMap();
     map.put(jobIDField,jobID);
     map.put(ownerIDField,ownerID);
-    if (dd.getLinkType().length() > 0)
-      map.put(linkTypeField,dd.getLinkType());
+    map.put(linkTypeField,dd.getLinkType());
     map.put(parentIDHashField,dd.getParentIDHash());
-    if (dd.getChildIDHash().length() > 0)
-    {
-      map.put(childIDHashField,dd.getChildIDHash());
-    }
+    map.put(childIDHashField,dd.getChildIDHash());
     performInsert(map,null);
     noteModifications(1,0,0);
   }



Mime
View raw message