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 2008/05/26 06:56:50 UTC
svn commit: r660101 - in
/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering:
canopy/CanopyDriver.java canopy/ClusterDriver.java kmeans/KMeansDriver.java
meanshift/MeanShiftCanopyDriver.java meanshift/MeanShiftCanopyJob.java
Author: srowen
Date: Sun May 25 21:56:50 2008
New Revision: 660101
URL: http://svn.apache.org/viewvc?rev=660101&view=rev
Log:
Updates to remove deprecation warnings in Hadoop 0.17.0
Modified:
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyDriver.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterDriver.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyDriver.java?rev=660101&r1=660100&r2=660101&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyDriver.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyDriver.java Sun May 25 21:56:50 2008
@@ -22,6 +22,8 @@
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.SequenceFileOutputFormat;
+import org.apache.hadoop.mapred.FileInputFormat;
+import org.apache.hadoop.mapred.FileOutputFormat;
public class CanopyDriver {
@@ -58,9 +60,9 @@
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(Text.class);
- conf.setInputPath(new Path(input));
+ FileInputFormat.setInputPaths(conf, new Path(input));
Path outPath = new Path(output);
- conf.setOutputPath(outPath);
+ FileOutputFormat.setOutputPath(conf, outPath);
conf.setMapperClass(CanopyMapper.class);
conf.setCombinerClass(CanopyCombiner.class);
@@ -72,7 +74,7 @@
try {
FileSystem dfs = FileSystem.get(conf);
if (dfs.exists(outPath))
- dfs.delete(outPath);
+ dfs.delete(outPath, true);
JobClient.runJob(conf);
} catch (Exception e) {
throw new RuntimeException(e);
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterDriver.java?rev=660101&r1=660100&r2=660101&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterDriver.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterDriver.java Sun May 25 21:56:50 2008
@@ -21,6 +21,8 @@
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.FileInputFormat;
+import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.lib.IdentityReducer;
public class ClusterDriver {
@@ -62,9 +64,9 @@
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(Text.class);
- conf.setInputPath(new Path(points));
+ FileInputFormat.setInputPaths(conf, new Path(points));
Path outPath = new Path(output + "/clusters");
- conf.setOutputPath(outPath);
+ FileOutputFormat.setOutputPath(conf, outPath);
conf.setMapperClass(ClusterMapper.class);
conf.setReducerClass(IdentityReducer.class);
@@ -73,7 +75,7 @@
try {
FileSystem dfs = FileSystem.get(conf);
if (dfs.exists(outPath))
- dfs.delete(outPath);
+ dfs.delete(outPath, true);
JobClient.runJob(conf);
} catch (Exception e) {
throw new RuntimeException(e);
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java?rev=660101&r1=660100&r2=660101&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java Sun May 25 21:56:50 2008
@@ -23,6 +23,8 @@
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.SequenceFileOutputFormat;
+import org.apache.hadoop.mapred.FileInputFormat;
+import org.apache.hadoop.mapred.FileOutputFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -64,7 +66,7 @@
Path outPath = new Path(output);
FileSystem fs = FileSystem.get(conf);
if (fs.exists(outPath)) {
- fs.delete(outPath);
+ fs.delete(outPath, true);
}
fs.mkdirs(outPath);
// iterate until the clusters converge
@@ -108,9 +110,9 @@
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(Text.class);
- conf.setInputPath(new Path(input));
+ FileInputFormat.setInputPaths(conf, new Path(input));
Path outPath = new Path(clustersOut);
- conf.setOutputPath(outPath);
+ FileOutputFormat.setOutputPath(conf, outPath);
conf.setMapperClass(KMeansMapper.class);
conf.setCombinerClass(KMeansCombiner.class);
@@ -149,9 +151,9 @@
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(Text.class);
- conf.setInputPath(new Path(input));
+ FileInputFormat.setInputPaths(conf, new Path(input));
Path outPath = new Path(output);
- conf.setOutputPath(outPath);
+ FileOutputFormat.setOutputPath(conf, outPath);
conf.setMapperClass(KMeansMapper.class);
conf.setNumReduceTasks(0);
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java?rev=660101&r1=660100&r2=660101&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java Sun May 25 21:56:50 2008
@@ -22,6 +22,8 @@
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.SequenceFileInputFormat;
import org.apache.hadoop.mapred.SequenceFileOutputFormat;
+import org.apache.hadoop.mapred.FileInputFormat;
+import org.apache.hadoop.mapred.FileOutputFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,9 +62,9 @@
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(Text.class);
- conf.setInputPath(new Path(input));
+ FileInputFormat.setInputPaths(conf, new Path(input));
Path outPath = new Path(output);
- conf.setOutputPath(outPath);
+ FileOutputFormat.setOutputPath(conf, outPath);
conf.setMapperClass(MeanShiftCanopyMapper.class);
conf.setCombinerClass(MeanShiftCanopyCombiner.class);
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java?rev=660101&r1=660100&r2=660101&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java Sun May 25 21:56:50 2008
@@ -62,7 +62,7 @@
Path outPath = new Path(output);
FileSystem fs = FileSystem.get(conf);
if (fs.exists(outPath)) {
- fs.delete(outPath);
+ fs.delete(outPath, true);
}
fs.mkdirs(outPath);
// iterate until the clusters converge