import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.*;
import org.apache.hadoop.mapreduce.lib.output.*;
import org.apache.hadoop.util.*;

public class ParallelFrequentItemsetMiner extends Configured implements Tool
{
		
	public static void main(String args[]) throws Exception
	{
		if (args.length != 2)
		{
			System.out.println("usage: <path to input database> <path to output files>");
			System.exit(1); 
		}

		int res = ToolRunner.run(new Configuration(), new ParallelFrequentItemsetMiner(), args);

		System.exit(res);
	}

	public int run(String args[]) throws Exception
	{
		long job_start_time, job_end_time; 
		long job_runtime; 
		int ret;
		
		Configuration conf = getConf(); 
			
		conf.setBoolean("mapred.reduce.tasks.speculative.execution", false); 
		conf.setInt("mapred.task.timeout", 60000000); 

		Job job = new Job(conf);

		job.setJarByClass(ParallelFrequentItemsetMiner.class);
			
		job.setMapOutputKeyClass(IntWritable.class); 
		job.setMapOutputValueClass(Text.class); 
			
		job.setOutputKeyClass(Text.class); 
		job.setOutputValueClass(IntWritable.class); 
			
		//job.setMapperClass(MapClass.class);
		//job.setMapperClass(MapClassBinomialSampler.class);
		job.setMapperClass(MapClassCoinFlipSampler.class);
		job.setReducerClass(ReduceClass.class);
			
		FileInputFormat.setInputPaths(job, new Path(args[0]));
		FileOutputFormat.setOutputPath(job, new Path(args[1]));
			
		job_start_time = System.currentTimeMillis(); 
		job.waitForCompletion(true);
		job_end_time = System.currentTimeMillis(); 
			
		job_runtime = (job_end_time-job_start_time) / 1000; 
			
		System.out.println("total job runtime (seconds): " + job_runtime); 

		if (job.isSuccessful())
		{
			ret = 0;
		} 
		else
		{
			ret = 1;
		}
		return ret;
	}
	
}


@@ -57,17 +57,67 @@
 op.conf.
-*
+Configured;%0Aimport org.apache.hadoop.io.IntWritable
 ;%0Aimport
@@ -138,17 +138,20 @@
 doop.io.
-*
+Text
 ;%0Aimport
@@ -179,13 +179,24 @@
 pred
-uce.*
+.FileInputFormat
 ;%0Aim
@@ -228,72 +228,145 @@
 pred
-uce.lib.input.*;%0Aimport org.apache.hadoop.mapreduce.lib.output.*
+.FileOutputFormat;%0Aimport org.apache.hadoop.mapred.JobClient;%0Aimport org.apache.hadoop.mapred.JobConf;%0Aimport org.apache.hadoop.util.Tool
 ;%0Aim
@@ -397,9 +397,18 @@
 til.
-*
+ToolRunner
 ;%0A%0Ap
@@ -717,29 +717,8 @@
 new 
-Configuration(), new 
 Para
@@ -893,43 +893,38 @@
  %0A%09%09
-int ret;%0A%09%09%0A%09%09Configuration conf = 
+%0A%09%09JobConf conf = new JobConf(
 getC
@@ -928,16 +928,17 @@
 etConf()
+)
 ; %0A%09%09%09%0A%09
@@ -1064,39 +1064,12 @@
 %0A%0A%09%09
-Job job = new Job(conf);%0A%0A%09%09job
+conf
 .set
@@ -1118,27 +1118,28 @@
 ass);%0A%09%09%09%0A%09%09
-job
+conf
 .setMapOutpu
@@ -1167,27 +1167,28 @@
 .class); %0A%09%09
-job
+conf
 .setMapOutpu
@@ -1219,19 +1219,20 @@
  %0A%09%09%09%0A%09%09
-job
+conf
 .setOutp
@@ -1258,19 +1258,20 @@
 ss); %0A%09%09
-job
+conf
 .setOutp
@@ -1308,27 +1308,28 @@
 ); %0A%09%09%09%0A%09%09//
-job
+conf
 .setMapperCl
@@ -1353,19 +1353,20 @@
 s);%0A%09%09//
-job
+conf
 .setMapp
@@ -1403,27 +1403,28 @@
 r.class);%0A%09%09
-job
+conf
 .setMapperCl
@@ -1461,19 +1461,20 @@
 ass);%0A%09%09
-job
+conf
 .setRedu
@@ -1524,19 +1524,19 @@
 tFormat.
-set
+add
 InputPat
@@ -1540,13 +1540,13 @@
 Path
-s(job
+(conf
 , ne
@@ -1596,19 +1596,20 @@
 putPath(
-job
+conf
 , new Pa
@@ -1680,34 +1680,29 @@
  %0A%09%09
-job.waitForCompletion(true
+JobClient.runJob(conf
 );%0A%09
@@ -1884,81 +1884,8 @@
 ; %0A%0A
-%09%09if (job.isSuccessful())%0A%09%09%7B%0A%09%09%09ret = 0;%0A%09%09%7D %0A%09%09else%0A%09%09%7B%0A%09%09%09ret = 1;%0A%09%09%7D
 %0A%09%09r
@@ -1890,19 +1890,17 @@
 %09return 
-ret
+0
 ;%0A%09%7D%0A%09%0A%7D

Convert ParallelFrequentItemsetMiner to the old API. It does not commit at the moment because ReduceClass hasn't been converted yet.