@@ -0,0 +1,1787 @@
+package clusterassign;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.mapreduce.Job;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.mapreduce.lib.input.FileInputFormat;%0Aimport org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;%0Aimport org.apache.hadoop.conf.Configuration;%0A%0Aimport datapoint.DataPoint;%0A%0A/**%0A  * Driver class for the package. Initializes the MapReduce job to assign Data Points to k-Means Centroids.%0A  */%0Apublic class ClusterAssignDriver%0A%7B%0A%09public static void main(String args%5B%5D)%0A%09%09throws Exception%0A%09%7B%0A%09%09// Check if a sufficient number of arguments are provided.%0A%09%09// args%5B0%5D = Path to file containing the Data Points%0A%09%09// args%5B1%5D = Path to file containing the k-Means Centroids%0A%09%09// args%5B2%5D = Path to output file%0A%09%09if(args.length != 3)%0A%09%09%7B%0A%09%09%09System.out.println(%22Usage: ClusterAssignDriver %3CInput Path%3E %3Ck-Centroids File%3E %3COutput Path%3E%22);%0A%09%09%09System.exit(-1);%0A%09%09%7D%0A%0A%09%09// Create a new configuration and add the path to the k-Means Centroid file as a parameter%0A%09%09Configuration configuration = new Configuration();%0A%09%09configuration.set(%22kCentroidsFile%22, args%5B1%5D);%0A%0A%09%09// Set up the job%0A%09%09Job job = new Job(configuration);%0A%09%09job.setJarByClass(ClusterAssignDriver.class);%0A%09%09job.setJobName(%22K-Means Clustering - Cluster Assignment%22);%0A%0A%09%09// Set the Mapper and Reducer class%0A%09%09job.setMapperClass(ClusterAssignMapper.class);%0A%09%09job.setReducerClass(ClusterAssignReducer.class);%0A%0A%09%09// Set paths for input and output files%0A%09%09FileInputFormat.addInputPath(job, new Path(args%5B0%5D));%0A%09%09FileOutputFormat.setOutputPath(job, new Path(args%5B2%5D));%0A%0A%09%09// Specify the class types of the key and value produced by the mapper and reducer%0A%09%09job.setOutputKeyClass(DataPoint.class);%0A%09%09job.setOutputValueClass(DataPoint.class);%0A%0A%09%09System.exit(job.waitForCompletion(true)?0:1);%0A%09%7D%0A%7D%0A

Create ClusterAssignDriver.java