Apache Nutch is an extensible and scalable web crawler
NUTCH-1911 - Recommit help fixes and remove 'current' folder requirement
Michael James Joyce7b87ac998005
diff --git a/CHANGES.txt b/CHANGES.txtindex 529e9337e..0ec3db2dd 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -3,6 +3,8 @@ Nutch Change LogNutch 1.11 Release 25/10/2015 (dd/mm/yyyy)Release Report: http://s.apache.org/nutch11+* NUTCH-1911 Improve DomainStatistics tool command line parsing (joyce)+* NUTCH-2064 URLNormalizer basic to encode reserved chars and decode non-reserved chars (markus, snagel)* NUTCH-2159 Ensure that all WebApp files are copied into generated artifacts for 1.X Webapp (lewismc)diff --git a/src/java/org/apache/nutch/util/domain/DomainStatistics.java b/src/java/org/apache/nutch/util/domain/DomainStatistics.javaindex 9ee60fb6f..6c1bd9eba 100644--- a/src/java/org/apache/nutch/util/domain/DomainStatistics.java+++ b/src/java/org/apache/nutch/util/domain/DomainStatistics.java@@ -17,6 +17,7 @@package org.apache.nutch.util.domain;+import java.io.File;import java.io.IOException;import java.net.URL;import java.text.SimpleDateFormat;@@ -65,8 +66,21 @@ public class DomainStatistics extends Configured implements Tool {public int run(String[] args) throws Exception {if (args.length < 3) {- System.out- .println("usage: DomainStatistics inputDirs outDir host|domain|suffix|tld [numOfReducer]");+ System.err.println("Usage: DomainStatistics inputDirs outDir mode [numOfReducer]");++ System.err.println("\tinputDirs\tComma separated list of crawldb input directories");+ System.err.println("\t\t\tE.g.: crawl/crawldb/");++ System.err.println("\toutDir\t\tOutput directory where results should be dumped");++ System.err.println("\tmode\t\tSet statistics gathering mode");+ System.err.println("\t\t\t\thost\tGather statistics by host");+ System.err.println("\t\t\t\tdomain\tGather statistics by domain");+ System.err.println("\t\t\t\tsuffix\tGather statistics by suffix");+ System.err.println("\t\t\t\ttld\tGather statistics by top level directory");++ System.err.println("\t[numOfReducers]\tOptional number of reduce jobs to use. Defaults to 1.");+return 1;}String inputDir = args[0];@@ -106,7 +120,8 @@ public class DomainStatistics extends Configured implements Tool {String[] inputDirsSpecs = inputDir.split(",");for (int i = 0; i < inputDirsSpecs.length; i++) {- FileInputFormat.addInputPath(job, new Path(inputDirsSpecs[i]));+ File completeInputPath = new File(new File(inputDirsSpecs[i]), "current");+ FileInputFormat.addInputPath(job, new Path(completeInputPath.toString()));}job.setInputFormatClass(SequenceFileInputFormat.class);