- //try {
- MapReduceClass mapreducer = new MapReduceClass();
-
- FileInputStream iStream = new FileInputStream(args[0]);
- byte[] b = new byte[1024];
- int length = iStream.read(b);
- if(length < 0 ) {
- System./*out.println*/printString("Error! Can not read from configure file: " + args[0] + "\n");
- System.exit(-1);
- }
- String content = new String(b, 0, length);
- //System.out.println(content);
- int index = content.indexOf('\n');
- String inputfile = content.substring(0, index);
- content = content.substring(index + 1);
- index = content.indexOf('\n');
- int m = Integer.parseInt(content.substring(0, index));
- content = content.substring(index + 1);
- index = content.indexOf('\n');
- int r = Integer.parseInt(content.substring(0, index));
- content = content.substring(index + 1);
- index = content.indexOf('\n');
- String temp = content.substring(0, index);
- char seperator = temp.charAt(0);
- //System.out.println(inputfile + "; " + String.valueOf(m) + "; " + String.valueOf(r));
-
- Configuration conf = new Configuration();
- conf.setMapReduceClass(mapreducer);
- conf.setInputfile(inputfile);
- conf.setM(m);
- conf.setR(r);
- conf.setSeperator(seperator);
-
- JobClient.runJob(conf);
- /*} catch (Exception e) {
- e.printStackTrace();
+ MapReduceClass mapreducer = new MapReduceClass();
+
+ FileInputStream iStream = new FileInputStream(args[0]);
+ byte[] b = new byte[1024];
+ int length = iStream.read(b);
+ if(length < 0 ) {
+ System.printString("Error! Can not read from configure file: " + args[0] + "\n");