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 2011/07/23 16:51:51 UTC
svn commit: r1150114 -
/mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/RowIdJob.java
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());