You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by ab...@apache.org on 2009/10/09 14:53:28 UTC

svn commit: r823532 - in /lucene/nutch/trunk: CHANGES.txt src/java/org/apache/nutch/scoring/webgraph/LinkRank.java

Author: ab
Date: Fri Oct  9 12:53:27 2009
New Revision: 823532

URL: http://svn.apache.org/viewvc?rev=823532&view=rev
Log:
NUTCH-730 NPE in LinkRank if no nodes with which to create the WebGraph.

Modified:
    lucene/nutch/trunk/CHANGES.txt
    lucene/nutch/trunk/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java

Modified: lucene/nutch/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/CHANGES.txt?rev=823532&r1=823531&r2=823532&view=diff
==============================================================================
--- lucene/nutch/trunk/CHANGES.txt (original)
+++ lucene/nutch/trunk/CHANGES.txt Fri Oct  9 12:53:27 2009
@@ -12,6 +12,9 @@
 * NUTCH-707 - Generation of multiple segments in multiple runs returns only 1 segment
   (Michael Chen, ab)
 
+* NUTCH-730 - NPE in LinkRank if no nodes with which to create the WebGraph
+  (Dennis Kubes via ab)
+
 Release 1.0 - 2009-03-23
 
  1. NUTCH-474 - Fetcher2 crawlDelay and blocking fix (Dogacan Guney via ab)

Modified: lucene/nutch/trunk/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java
URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java?rev=823532&r1=823531&r2=823532&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java (original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/scoring/webgraph/LinkRank.java Fri Oct  9 12:53:27 2009
@@ -122,7 +122,13 @@
     BufferedReader buffer = new BufferedReader(new InputStreamReader(readLinks));
     String numLinksLine = buffer.readLine();
     readLinks.close();
-
+    
+    // check if there are links to process, if none, webgraph might be empty
+    if (numLinksLine == null || numLinksLine.length() == 0) {
+      fs.delete(numLinksPath, true);
+      throw new IOException("No links to process, is the webgraph empty?");
+    }
+    
     // delete temp file and convert and return the number of links as an int
     LOG.info("Deleting numlinks temp file");
     fs.delete(numLinksPath, true);