Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-1299 LinkRank inverter to ignore records without Node

Markus Jelsma1f6c25eec590
diff --git a/CHANGES.txt b/CHANGES.txt
index da4342cba..8c0219e7f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
Nutch Change Log
+* NUTCH-1299 LinkRank inverter to ignore records without Node (markus)
+
* NUTCH-1258 MoreIndexingFilter should be able to read Content-Type from both parse metadata and content metadata (jnioche, markus)
* NUTCH-1293 IndexingFiltersChecker to store detected content type in crawldatum metadata (markus)
diff --git a/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java b/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java
index 0674c881f..7f342f442 100644
--- a/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java
+++ b/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java
@@ -404,6 +404,16 @@ public class LinkRank
}
}
+ // Check for the possibility of a LoopSet object without Node and LinkDatum objects. This can happen
+ // with webgraphs that receive deletes (e.g. link.delete.gone and/or URL filters or normalizers) but
+ // without an updated Loops database.
+ // See: https://issues.apache.org/jira/browse/NUTCH-1299
+ if (node == null && loops != null) {
+ // Nothing to do
+ LOG.warn("LoopSet without Node object received for " + key.toString() + " . You should either not use Loops as input of the LinkRank program or rerun the Loops program over the WebGraph.");
+ return;
+ }
+
// get the number of outlinks and the current inlink and outlink scores
// from the node of the url
int numOutlinks = node.getNumOutlinks();