Apache Nutch is an extensible and scalable web crawler
NUTCH-1646 IndexerMapReduce to consider DB status
Markus Jelsmaaa3b90afea7d
diff --git a/CHANGES.txt b/CHANGES.txtindex 018a8fe1f..4923d1b08 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change LogNutch Development Trunk+* NUTCH-1646 IndexerMapReduce to consider DB status (markus)+* NUTCH-1636 Indexer to normalize and filter repr URL (Iain Lopata via snagel)* NUTCH-1637 URLUtil is missing getProtocol (markus)diff --git a/src/java/org/apache/nutch/indexer/IndexerMapReduce.java b/src/java/org/apache/nutch/indexer/IndexerMapReduce.javaindex b1e22e8a4..af9af3abd 100644--- a/src/java/org/apache/nutch/indexer/IndexerMapReduce.java+++ b/src/java/org/apache/nutch/indexer/IndexerMapReduce.java@@ -189,14 +189,18 @@ implements Mapper<Text, Writable, Text, NutchWritable>,* Check if we need to delete 404 NOT FOUND and 301 PERMANENT REDIRECT.*/if (delete) {- if (fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_GONE) {+ if (fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_GONE || dbDatum.getStatus() == CrawlDatum.STATUS_DB_GONE) {reporter.incrCounter("IndexerStatus", "Documents deleted", 1);NutchIndexAction action = new NutchIndexAction(null, NutchIndexAction.DELETE);output.collect(key, action);return;}- if (fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_REDIR_PERM) {+ if (fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_REDIR_PERM ||+ fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_REDIR_TEMP ||+ dbDatum.getStatus() == CrawlDatum.STATUS_DB_REDIR_PERM ||+ dbDatum.getStatus() == CrawlDatum.STATUS_DB_REDIR_TEMP) {+ reporter.incrCounter("IndexerStatus", "Deleted redirects", 1);reporter.incrCounter("IndexerStatus", "Perm redirects deleted", 1);NutchIndexAction action = new NutchIndexAction(null, NutchIndexAction.DELETE);