Apache Nutch is an extensible and scalable web crawler
NUTCH-1514 Phase out the deprecated configuration properties (if possible)
Tejas Patil4ab47fbe174e
diff --git a/CHANGES.txt b/CHANGES.txtindex 7e1f9a74e..9425c9aac 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change Log(trunk): Current Development+* NUTCH-1514 Phase out the deprecated configuration properties (if possible) (tejasp)+* NUTCH-1334 NPE in FetcherOutputFormat (jnioche via tejasp)* NUTCH-1549 Fix deprecated use of Tika MimeType API in o.a.n.util.MimeUtil (tejasp)diff --git a/conf/nutch-default.xml b/conf/nutch-default.xmlindex 330e54837..8690d7599 100644--- a/conf/nutch-default.xml+++ b/conf/nutch-default.xml@@ -324,13 +324,6 @@<!-- web db properties -->-<property>- <name>db.default.fetch.interval</name>- <value>30</value>- <description>(DEPRECATED) The default number of days between re-fetches of a page.- </description>-</property>-<property><name>db.fetch.interval.default</name><value>2592000</value>@@ -610,14 +603,6 @@updatedb will generate identical fetchlists.</description></property>-<property>- <name>generate.max.per.host</name>- <value>-1</value>- <description>(Deprecated). Use generate.max.count and generate.count.mode instead.- The maximum number of urls per host in a single- fetchlist. -1 if unlimited.</description>-</property>-<property><name>generate.min.score</name><value>0</value>@@ -698,8 +683,7 @@<name>fetcher.threads.per.queue</name><value>1</value><description>This number is the maximum number of threads that- should be allowed to access a queue at one time. Replaces- deprecated parameter 'fetcher.threads.per.host'.+ should be allowed to access a queue at one time.</description></property>@@ -707,8 +691,7 @@<name>fetcher.queue.mode</name><value>byHost</value><description>Determines how to put URLs into queues. Default value is 'byHost',- also takes 'byDomain' or 'byIP'. Replaces the deprecated parameter- 'fetcher.threads.per.host.by.ip'.+ also takes 'byDomain' or 'byIP'.</description></property>diff --git a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.javaindex 4a4595ecb..07971a065 100755--- a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java+++ b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java@@ -47,12 +47,8 @@ public abstract class AbstractFetchSchedule extends Configured implements FetchSpublic void setConf(Configuration conf) {super.setConf(conf);if (conf == null) return;- int oldDefaultInterval = conf.getInt("db.default.fetch.interval", 0);defaultInterval = conf.getInt("db.fetch.interval.default", 0);- if (oldDefaultInterval > 0 && defaultInterval == 0) defaultInterval = oldDefaultInterval * SECONDS_PER_DAY;- int oldMaxInterval = conf.getInt("db.max.fetch.interval", 0);maxInterval = conf.getInt("db.fetch.interval.max", 0 );- if (oldMaxInterval > 0 && maxInterval == 0) maxInterval = oldMaxInterval * FetchSchedule.SECONDS_PER_DAY;LOG.info("defaultInterval=" + defaultInterval);LOG.info("maxInterval=" + maxInterval);}diff --git a/src/java/org/apache/nutch/crawl/Generator.java b/src/java/org/apache/nutch/crawl/Generator.javaindex 777e67efd..0738a0420 100644--- a/src/java/org/apache/nutch/crawl/Generator.java+++ b/src/java/org/apache/nutch/crawl/Generator.java@@ -76,7 +76,6 @@ public class Generator extends Configured implements Tool {// deprecated parameterspublic static final String GENERATE_MAX_PER_HOST_BY_IP = "generate.max.per.host.by.ip";- public static final String GENERATE_MAX_PER_HOST = "generate.max.per.host";public static class SelectorEntry implements Writable {public Text url;@@ -140,10 +139,7 @@ public class Generator extends Configured implements Tool {curTime = job.getLong(GENERATOR_CUR_TIME, System.currentTimeMillis());limit = job.getLong(GENERATOR_TOP_N, Long.MAX_VALUE) / job.getNumReduceTasks();maxCount = job.getInt(GENERATOR_MAX_COUNT, -1);- // back compatibility with old param- int oldMaxPerHost = job.getInt(GENERATE_MAX_PER_HOST, -1);- if (maxCount==-1 && oldMaxPerHost!=-1){- maxCount = oldMaxPerHost;+ if (maxCount==-1){byDomain = false;}if (GENERATOR_COUNT_VALUE_DOMAIN.equals(job.get(GENERATOR_COUNT_MODE))) byDomain = true;