You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2010/01/22 15:43:49 UTC

svn commit: r902104 - /lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java

Author: srowen
Date: Fri Jan 22 14:43:49 2010
New Revision: 902104

URL: http://svn.apache.org/viewvc?rev=902104&view=rev
Log:
Rest of MAHOUT-249

Modified:
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java?rev=902104&r1=902103&r2=902104&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaXmlSplitter.java Fri Jan 22 14:43:49 2010
@@ -39,6 +39,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.compress.BZip2Codec;
 import org.apache.hadoop.io.compress.CompressionCodec;
+import org.apache.mahout.common.CommandLineUtil;
 import org.apache.mahout.common.FileLineIterator;
 
 /**
@@ -65,7 +66,12 @@
         .withRequired(true)
         .withArgument(
           abuilder.withName("outputDir").withMinimum(1).withMaximum(1).create())
-        .withDescription("The output directory to place the splits in")
+        .withDescription("The output directory to place the splits in:\n" +
+                    "local files:\n\t/var/data/wikipedia-xml-chunks or\n\tfile:///var/data/wikipedia-xml-chunks\n" +
+                    "Hadoop DFS:\n\thdfs://wikipedia-xml-chunks\n" +
+                    "AWS S3 (blocks):\n\ts3://bucket-name/wikipedia-xml-chunks\n" +
+                    "AWS S3 (native files):\n\ts3n://bucket-name/wikipedia-xml-chunks\n")
+
         .withShortName("o").create();
 
     Option s3IdOpt = obuilder
@@ -104,7 +110,14 @@
     
     Parser parser = new Parser();
     parser.setGroup(group);
-    CommandLine cmdLine = parser.parse(args);
+    CommandLine cmdLine;
+    try {
+      cmdLine = parser.parse(args);
+    } catch (OptionException e) {
+      System.err.println(e.getMessage());
+      CommandLineUtil.printHelp(group);
+      return;
+    }
 
     Configuration conf = new Configuration();
     String dumpFilePath = (String) cmdLine.getValue(dumpFileOpt);