Apache Nutch is an extensible and scalable web crawler
Generator: improve description of crawl.gen.delay
Sebastian Nagel2f310ae105cb
diff --git a/conf/nutch-default.xml b/conf/nutch-default.xmlindex ca3a949be..dac167daf 100644--- a/conf/nutch-default.xml+++ b/conf/nutch-default.xml@@ -862,8 +862,9 @@generate/fetch/update cycles may overlap, setting this to true ensuresthat generate will create different fetchlists even without interveningupdatedb-s, at the cost of running an additional job to update CrawlDB.- If false, running generate twice without intervening- updatedb will generate identical fetchlists.</description>+ If false, running generate twice without intervening updatedb will+ generate identical fetchlists. See also crawl.gen.delay which defines+ how long items already generated are blocked.</description></property><property>@@ -927,8 +928,9 @@<description>This value, expressed in milliseconds, defines how long we should keep the lock on recordsin CrawlDb that were just selected for fetching. If these records are not updated- in the meantime, the lock is canceled, i.e. they become eligible for selecting.- Default value of this is 7 days (604800000 ms).+ in the meantime, the lock is canceled, i.e. they become eligible for selecting again.+ Default value of this is 7 days (604800000 ms). If generate.update.crawldb is false+ the property crawl.gen.delay has no effect.</description></property>diff --git a/src/java/org/apache/nutch/crawl/Generator.java b/src/java/org/apache/nutch/crawl/Generator.javaindex f9fba6a13..1c5e4d520 100644--- a/src/java/org/apache/nutch/crawl/Generator.java+++ b/src/java/org/apache/nutch/crawl/Generator.java@@ -193,8 +193,8 @@ public class Generator extends NutchTool implements Tool {filters = new URLFilters(conf);scfilters = new ScoringFilters(conf);filter = conf.getBoolean(GENERATOR_FILTER, true);- genDelay = conf.getLong(GENERATOR_DELAY, 604800000L); // 7 days as- // default.+ /* CrawlDb items are unblocked after 7 days as default */+ genDelay = conf.getLong(GENERATOR_DELAY, 604800000L);long time = conf.getLong(Nutch.GENERATE_TIME_KEY, 0L);if (time > 0)genTime.set(time);@@ -775,11 +775,9 @@ public class Generator extends NutchTool implements Tool {Job job = NutchJob.getInstance(getConf());job.setJobName("generate: select from " + dbDir);Configuration conf = job.getConfiguration();- if (numLists == -1) { // for politeness make- numLists = Integer.parseInt(conf.get("mapreduce.job.maps")); // a- // partition- // per fetch- // task+ if (numLists == -1) {+ /* for politeness create exactly one partition per fetch task */+ numLists = Integer.parseInt(conf.get("mapreduce.job.maps"));}if ("local".equals(conf.get("mapreduce.framework.name")) && numLists != 1) {// override