Changes between Version 13 and Version 14 of LogParser
- Timestamp:
- Jul 7, 2008, 12:13:29 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LogParser
v13 v14 39 39 public static class MapClass extends MapReduceBase implements 40 40 Mapper<WritableComparable, Text, Text, Writable> { 41 @Override42 // MapReduceBase.configure(JobConf job)43 // Default implementation that does nothing.44 41 public void configure(JobConf job) { 45 // String get(String name,String defaultValue)46 // Get the value of the name property. If no such property exists,\47 // then defaultValue is returned.48 42 tableName = job.get(TABLE, ""); 49 43 } 50 51 44 public void map(WritableComparable key, Text value, 52 45 OutputCollector<Text, Writable> output, Reporter reporter) 53 46 throws IOException { 54 55 47 try { 56 /*57 print(value.toString());58 FileWriter out = new FileWriter(new File(59 "/home/waue/mr-result.txt"));60 out.write(value.toString());61 out.flush();62 out.close();63 */64 48 LogParser log = new LogParser(value.toString()); 65 66 49 if (table == null) 67 50 table = new HTable(conf, new Text(tableName)); … … 82 65 log.getUrl().getBytes()); 83 66 table.commit(lockId, log.getTimestamp()); 84 85 67 } catch (Exception e) { 86 68 e.printStackTrace(); 87 69 } 88 89 70 } 90 71 }