mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r1150114 - /mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java
Date Sat, 23 Jul 2011 14:51:51 GMT
Author: srowen
Date: Sat Jul 23 14:51:51 2011
New Revision: 1150114

URL: http://svn.apache.org/viewvc?rev=1150114&view=rev
Log:
MAHOUT-757 use standard input/output options

Modified:
    mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java?rev=1150114&r1=1150113&r2=1150114&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java Sat
Jul 23 14:51:51 2011
@@ -38,10 +38,14 @@ public class RowIdJob extends AbstractJo
 
   @Override
   public int run(String[] strings) throws Exception {
+
+    addInputOption();
+    addOutputOption();
+
     Configuration conf = getConf();
     FileSystem fs = FileSystem.get(conf);
-    Path inputPath = fs.makeQualified(new Path(conf.get("mapred.input.dir")));
-    Path outputPath = fs.makeQualified(new Path(conf.get("mapred.output.dir")));
+
+    Path outputPath = getOutputPath();
     Path indexPath = new Path(outputPath, "docIndex");
     Path matrixPath = new Path(outputPath, "matrix");
     SequenceFile.Writer indexWriter = SequenceFile.createWriter(fs,
@@ -59,7 +63,12 @@ public class RowIdJob extends AbstractJo
       int i = 0;
       int numCols = 0;
       for (Pair<Text,VectorWritable> record :
-         new SequenceFileDirIterable<Text,VectorWritable>(inputPath, PathType.LIST,
null, null, true, conf)) {
+           new SequenceFileDirIterable<Text,VectorWritable>(getInputPath(),
+                                                            PathType.LIST,
+                                                            null,
+                                                            null,
+                                                            true,
+                                                            conf)) {
         VectorWritable value = record.getSecond();
         docId.set(i);
         indexWriter.append(docId, record.getFirst());



Mime
View raw message