/** Copyright(c) 2012 Orzota, Inc. All Rights Reserved. **/
package com.orzota.bookx;

// imported jars
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat;

/**
 * @organisaion Orzota, Inc.
 * @author varadmeru
 */
public class BookXDriver {
	public static void main(String[] args) {
		JobClient client = new JobClient();
		// Configurations for Job set in this variable
		JobConf conf = new JobConf(com.orzota.bookx.BookXDriver.class);
		
		// Name of the Job
		conf.setJobName("BookCrossing1.0");
		
		// Data type of Output Key and Value
		conf.setOutputKeyClass(Text.class);
		conf.setOutputValueClass(IntWritable.class);
		
		// Setting the Mapper and Reducer Class
		conf.setMapperClass(com.orzota.bookx.BookXMapper.class);
		conf.setReducerClass(com.orzota.bookx.BookXReducer.class);

		// Formats of the Data Type of Input and output
		conf.setInputFormat(TextInputFormat.class);
		conf.setOutputFormat(TextOutputFormat.class);
		
		// Specify input and output DIRECTORIES (not files)
		FileInputFormat.setInputPaths(conf, new Path(args[0]));
		FileOutputFormat.setOutputPath(conf, new Path(args[1]));
		
		client.setConf(conf);
		try {
			// Running the job with Configurations set in the conf.
			JobClient.runJob(conf);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

@@ -233,24 +233,37 @@
 adoop.mapred
+uce.lib.input
 .FileInputFo
@@ -299,16 +299,30 @@
 p.mapred
+uce.lib.output
 .FileOut
@@ -367,18 +367,15 @@
 pred
+uce
 .Job
-Client
 ;%0Aim
@@ -407,49 +407,21 @@
 pred
-.JobConf;%0Aimport org.apache.hadoop.mapred
+uce.lib.input
 .Tex
@@ -465,16 +465,30 @@
 p.mapred
+uce.lib.output
 .TextOut
@@ -557,16 +557,72 @@
 eru%0A */%0A
+ /*%0A Update history : Updating for newer Hadoop API%0A */%0A
 public c
@@ -637,17 +637,17 @@
 kXDriver
- 
+%0A
 %7B%0A%09publi
@@ -684,166 +684,90 @@
 gs) 
-%7B%0A%09%09JobClient client = new JobClient();%0A%09%09// Configurations for Job set in this variable%0A%09%09JobConf conf = new JobConf(com.orzota.bookx.BookXDriver.class
+throws Exception%0A%09%7B%0A%09%09@SuppressWarnings(%22deprecation%22)%0A%09%09Job job = new Job(
 );%0A%09%09%0A
+%0A
 %09%09//
@@ -785,20 +785,19 @@
 e Job%0A%09%09
-conf
+job
 .setJobN
@@ -819,24 +819,65 @@
 ng1.0%22);%0A%09%09%0A
+%09%09job.setJarByClass(BookXDriver.class);%0A%0A
 %09%09// Data ty
@@ -905,20 +905,19 @@
 Value%0A%09%09
-conf
+job
 .setOutp
@@ -934,36 +934,35 @@
 (Text.class);%0A%09%09
-conf
+job
 .setOutputValueC
@@ -982,26 +982,24 @@
 ble.class);%0A
-%09%09
 %0A%09%09// Settin
@@ -1031,20 +1031,19 @@
 Class%0A%09%09
-conf
+job
 .setMapp
@@ -1085,28 +1085,27 @@
 r.class);%0A%09%09
-conf
+job
 .setReducerC
@@ -1197,23 +1197,27 @@
 d output
-%0A%09%09conf
+%09%09%09%0A%09%09//job
 .setInpu
@@ -1219,24 +1219,29 @@
 tInputFormat
+Class
 (TextInputFo
@@ -1255,20 +1255,21 @@
 ass);%0A%09%09
-conf
+//job
 .setOutp
@@ -1276,16 +1276,21 @@
 utFormat
+Class
 (TextOut
@@ -1309,16 +1309,18 @@
 ass);%0A%09%09
+%09%0A
 %0A%09%09// Sp
@@ -1384,19 +1384,19 @@
 tFormat.
-set
+add
 InputPat
@@ -1400,14 +1400,13 @@
 Path
-s(conf
+( job
 , ne
@@ -1456,20 +1456,20 @@
 putPath(
-conf
+ job
 , new Pa
@@ -1488,40 +1488,62 @@
 ;%0A%09%09
-%0A%09%09client.setConf(conf);%0A%09%09try %7B
+//job.submit();%0A%09%09//job.waitForCompletion(true);%0A%09%09%0A%09%09
 %0A%09%09%09
@@ -1604,86 +1604,56 @@
 .%0A%09%09
-%09JobClient.runJob(conf);%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace(
+System.exit(job.waitForCompletion(true)?0:1
 );%0A%09%09
-%7D
 %0A%09%7D%0A

Update BookXDriver.java