You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by fe...@apache.org on 2012/07/10 17:01:56 UTC

svn commit: r1359716 - in /nutch/branches/2.x: CHANGES.txt src/java/org/apache/nutch/crawl/GeneratorMapper.java

Author: ferdy
Date: Tue Jul 10 15:01:55 2012
New Revision: 1359716

URL: http://svn.apache.org/viewvc?rev=1359716&view=rev
Log:
NUTCH-1428 GeneratorMapper should not initialize filters/normalizers when they are disabled

Modified:
    nutch/branches/2.x/CHANGES.txt
    nutch/branches/2.x/src/java/org/apache/nutch/crawl/GeneratorMapper.java

Modified: nutch/branches/2.x/CHANGES.txt
URL: http://svn.apache.org/viewvc/nutch/branches/2.x/CHANGES.txt?rev=1359716&r1=1359715&r2=1359716&view=diff
==============================================================================
--- nutch/branches/2.x/CHANGES.txt (original)
+++ nutch/branches/2.x/CHANGES.txt Tue Jul 10 15:01:55 2012
@@ -1,6 +1,9 @@
 Nutch Change Log
 
 Release 2.1 - Current Development
+
+* NUTCH-1428 GeneratorMapper should not initialize filters/normalizers when they are disabled (ferdy)
+
 * NUTCH-1427 Reuse SelectorEntry in Generator. (ferdy)
 
 * NUTCH-1411 nutchgora fetcher.store.content does not work (Alexander Kingson via ferdy) 

Modified: nutch/branches/2.x/src/java/org/apache/nutch/crawl/GeneratorMapper.java
URL: http://svn.apache.org/viewvc/nutch/branches/2.x/src/java/org/apache/nutch/crawl/GeneratorMapper.java?rev=1359716&r1=1359715&r2=1359716&view=diff
==============================================================================
--- nutch/branches/2.x/src/java/org/apache/nutch/crawl/GeneratorMapper.java (original)
+++ nutch/branches/2.x/src/java/org/apache/nutch/crawl/GeneratorMapper.java Tue Jul 10 15:01:55 2012
@@ -95,13 +95,15 @@ extends GoraMapper<String, WebPage, Sele
   @Override
   public void setup(Context context) {
     Configuration conf = context.getConfiguration();
-    filters = new URLFilters(conf);
-    curTime =
-      conf.getLong(GeneratorJob.GENERATOR_CUR_TIME, System.currentTimeMillis());
-    normalizers =
-      new URLNormalizers(conf, URLNormalizers.SCOPE_GENERATE_HOST_COUNT);
     filter = conf.getBoolean(GeneratorJob.GENERATOR_FILTER, true);
     normalise = conf.getBoolean(GeneratorJob.GENERATOR_NORMALISE, true);
+    if (filter) {
+      filters = new URLFilters(conf);
+    }
+    if (normalise) {
+      normalizers = new URLNormalizers(conf, URLNormalizers.SCOPE_GENERATE_HOST_COUNT);
+    }
+    curTime = conf.getLong(GeneratorJob.GENERATOR_CUR_TIME, System.currentTimeMillis());
     schedule = FetchScheduleFactory.getFetchSchedule(conf);
     scoringFilters = new ScoringFilters(conf);
   }